summaryrefslogtreecommitdiffstats
path: root/scene/resources/dynamic_font.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Complex Text Layouts] Refactor Font class, default themes and controls to ↵bruvzg2020-11-261-1156/+0
| | | | | | | | use Text Server interface. Implement interface mirroring. Add TextLine and TextParagraph classes. Handle UTF-16 input on macOS and Windows.
* Update scene/resources/dynamic_font.cppJuan Linietsky2020-10-281-0/+2
| | | Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
* Implement CanvasGroup and CanvasItem clippingreduz2020-10-281-2/+13
| | | | | | | | -Allows merging several 2D objects into a single draw operation -Use current node to clip children nodes -Further fixes to Vulkan barriers -Changed font texture generation to white, fixes dark eges when blurred -Other small misc fixes to backbuffer code.
* Refactored 2D shader and lighting systemreduz2020-10-241-1/+1
| | | | | | | | | | -Removed normal/specular properties from nodes -Create CanvasTexture, which can contain normal/specular channels -Refactored, optimized and simplified 2D shaders -Use atlas for light textures. -Use a shadow atlas for shadow textures. -Use both items aboves to make light rendering stateless (faster). -Reorganized uniform sets for more efficiency.
* [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg2020-09-031-8/+8
|
* Add DynamicFont::get_available_chars()Pedro J. Estébanez2020-07-201-0/+36
|
* Disable antialiasing on the DynamicFont outline as well when requestedHugo Locurcio2020-05-281-1/+1
| | | | | This partially addresses https://github.com/godotengine/godot-proposals/issues/943.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-38/+75
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-64/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Use underline position and thickness value in font filevolzhs2020-04-291-0/+28
|
* Exposed RenderingDevice to script APIJuan Linietsky2020-04-201-1/+1
| | | | | | | | | | | | | Also added an easier way to load native GLSL shaders. Extras: Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload. Note: The precommit hooks are broken because they don't seem to support enums from one class being used in another. Feel free to fix this after merging this PR.
* Replace NULL with nullptrlupoDharkael2020-04-021-9/+9
|
* Fix out of bound array access caused by unassigned variableRafał Mikrut2020-04-011-0/+1
|
* Renaming of servers for coherency.Juan Linietsky2020-03-271-1/+1
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-6/+6
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Removed interactive loader, added proper thread loading.Juan Linietsky2020-02-281-1/+1
|
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-35/+24
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-2/+2
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* A lot of progress with canvas rendering, still far from working.Juan Linietsky2020-02-111-1/+1
|
* Texture refactorJuan Linietsky2020-02-111-52/+2
| | | | | | | | -Texture renamed to Texture2D -TextureLayered as base now inherits 2Darray, cubemap and cubemap array -Removed all references to flags in textures (they will go in the shader) -Texture3D gone for now (will come back later done properly) -Create base rasterizer for RenderDevice, RasterizerRD
* Use modules_enabled.gen.h to improve inter dependency checksRémi Verschelde2020-02-071-1/+4
| | | | | | | - Fix build with gdscript module disabled. Fixes #31011. - Remove unused `gdscript` compile option. - Fix build with regex module disabled. - Fix ImageLoaderSVG to forward declare thirdparty structs.
* Allow greater values for DynamicFont size propertyRémi Verschelde2020-01-211-2/+2
| | | | | | | | | See https://github.com/godotengine/godot/issues/22581#issuecomment-576836691. Not using `or_greater` as there *is* a max size value that the current implementation can accept. If using e.g. size 6000 with FiraSans-Regular.ttf, errors are printed due to failing asserts on a glyph size that should be within 4096x4096 px.
* Destroys FreeType library on load errorHaoyu Qiu2020-01-201-2/+9
|
* Fix typos with codespellRémi Verschelde2020-01-151-1/+1
| | | | | | Using codespell 1.16.0. See ab3bccdb78cc7dffb6ab796053ef63489f05558d for procedure.
* Update size and position for colored font with oversamplingvolzhs2020-01-071-4/+18
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Fixes crash when using DynamicFont::set_font_dataHaoyu Qiu2019-12-101-0/+1
|
* fix dynamic font crash if no available font sizeRodolfo Ribeiro Gomes2019-09-291-1/+1
|
* Added some obvious errors explanationsqarmin2019-09-251-6/+5
|
* Replace last occurrences of 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG'Rémi Verschelde2019-08-171-8/+0
| | | | | | | | | | The last remaining ERR_EXPLAIN call is in FreeType code and makes sense as is (conditionally defines the error message). There are a few ERR_EXPLAINC calls for C-strings where String is not included which can stay as is to avoid adding additional _MSGC macros just for that. Part of #31244.
* Remove ERR_EXPLAIN from scene/* codeTomasz Chabora2019-08-091-8/+5
|
* Add some code changes/fixes proposed by Coverity and Clang Tidyqarmin2019-08-071-1/+1
|
* Add a property hint for DynamicFont sizeHugo Locurcio2019-05-021-1/+1
| | | | | | This caps its size to reasonable values in the Inspector. This closes #22581.
* Fix warning when setting out of range outline_sizeMarcin Zawiejski2019-01-231-1/+1
| | | Fixes the warning mentioned in #25046
* Fix font kerningvolzhs2019-01-051-16/+0
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix colored font rendered in wrong sizevolzhs2018-12-191-1/+1
| | | | | | | | | Fix #24456 The character->rect.size is properly update at DynamicFontAtSize::_bitmap_to_character so no need to multiply scale again. It was changed with 5cd12f6649387f91d08fd17bf3c70e732798ab58
* Add a property to control DynamicFont anti-aliasingHugo Locurcio2018-11-101-1/+17
| | | | | | | - Editor font anti-aliasing can now be disabled in the Editor Settings. - DynamicFonts used in projects can now have their anti-aliasing disabled in their DynamicFontData child. Changes will be visible upon reloading the scene in the editor.
* -Moved EditorDefaultValue to ClassDB, made it coreJuan Linietsky2018-11-081-4/+4
| | | | -Removed one and zero hints for properties, replaced by default value
* Moved dynamic font list from static to lifetime controlled by main.Ibrahn Sahir2018-10-201-9/+11
| | | | | | Means the list is destroyed before the OS object, allowing it the opportunity to print an error if there are still dynamic font objects hanging around.
* Fixing warnings generated by MSVCDualtagh Murray2018-10-191-2/+2
| | | | Fixes #22684.
* Fix fallback font oversampling.Akeru2018-10-031-0/+11
|
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-2/+2
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* missed outline size in previous commitJuan Linietsky2018-08-241-0/+1
|
* Initalize font size to 16, closes #21165Juan Linietsky2018-08-241-0/+1
|
* Make some debug prints verbose-only, remove othersRémi Verschelde2018-08-241-2/+0
|
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-12/+12
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Removed unnecessary assignmentsWilson E. Alvarez2018-07-241-2/+2
|
* Fix the DynamicFont hinting setting being ineffectiveHugo Locurcio2018-06-291-1/+1
|