summaryrefslogtreecommitdiff
path: root/scene/resources/dynamic_font.cpp
AgeCommit message (Collapse)Author
2018-05-14Ceil char width within Label instead of FontRuslan Mustakov
Some classes use Font::get_char_size directly and not only for autowrapping. RichTextLabel is one such example. So this commit reverts aa8561d (PR #17504) and instead ceils character width within Label. This makes sure Label autowraps correctly while not affecting other Font clients. Fixes #18835.
2018-05-11Update oversampling of outlines after window size changeRuslan Mustakov
Fixes #18774.
2018-05-08Always emit dynamic font change in update_oversamplingRuslan Mustakov
Fixes #15787. The issue occurred when two (or more) separate DynamicFont instances used the same DynamicFontAtSize instance due to having equal properties. The first instance updated its data_at_size and emitted "changed" signal, but the second did not because it considered the data_at_size to be up to date, even though it has just been updated.
2018-05-08Perfect FreeType-based outlines for DynamicFontsRuslan Mustakov
- Implement outlines based on FreeType Stroker API. This allows artifact-free results, similar to what you will see in Web or any text editing tools. Outline is a part of DynamicFont rather than Label, because outlines have to be baked into the font's atlas. Font has a default outline_color and a Label can specify font_outline_modulator that will be multiplied with the Font's color to get the final result. - draw_char now has to be called twice to fully render a text - first with p_outline == true for each character and then with p_outline == false for each character. - Number of draw-calls is reduced from 5 to 2 per outlined character. - Overall cleanup of DynamicFont code, extracted duplicated code pieces into separate methods. - The change is backward-compatible - Labels still have outline properties that work exactly as they worked before. Closes #16279.
2018-03-14Ceil dynamic font glyph sizeRuslan Mustakov
Fixes #15459. When oversampling is enabled, glyphs may have fractional size, but they are still rendered into integral pixels, which results in them taking more space than was anticiped by autowrapping algorithm. The solution here is to return ceiled width, which makes autowrapper consider characters a bit larger than they are, but it doesn't hurt the actual rendering and ensures there is enough space for the characters.
2018-02-28Add an hinting mode setting to DynamicFontsHugo Locurcio
- Editor font hinting can now be tweaked in the Editor Settings. - DynamicFonts used in projects now have tweakable hinting settings in their DynamicFontData child. Changes will be visible upon reloading the scene in the editor.
2018-02-19Merge pull request #15780 from volzhs/emojiRémi Verschelde
Support colored font
2018-01-21I have no idea why this commit fixes #15392Juan Linietsky
2018-01-16Support colored fontvolzhs
2018-01-08Two potential glitches in font oversamplingBernhard Liebl
2018-01-07Fix stale dynamic font reference fetch from cacheBernhard Liebl
Seems to fix issue 15392
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2017-12-19Make dynamic font oversampling fully dynamic.Juan Linietsky
2017-12-19Added font oversampling supportJuan Linietsky
2017-11-25Made Vector::ptrw explicit for writing, compiler was sometimes using the ↵Juan Linietsky
wrong function, leading to unnecesary copy on writes and reduced performance.
2017-11-09Remove get_default_video_mode definition on OSX/iOSRémi Verschelde
It had been missed in d09160a8b67fdc60e8108962c4e9bd4c0bc7f13e and broke compilation for those platforms. Took the opportunity to run clang-format on the code base to fix some corner cases that went through our static tests/were overlooked recently.
2017-09-21Merge pull request #11365 from leezh/freetype_monoRémi Verschelde
Added support for FT_PIXEL_MODE_MONO in FreeType
2017-09-20Rename pos to position in user facing methods and variablesletheed
Rename user facing methods and variables as well as the corresponding C++ methods according to the folloming changes: * pos -> position * rot -> rotation * loc -> location C++ variables are left as is.
2017-09-19Added support for FT_PIXEL_MODE_MONO in FreeTypeZher Huei Lee
2017-08-27Use HTTPS URL for Godot's website in the headersRémi Verschelde
2017-08-20ClassDB: Provide the enum name of integer constantsIgnacio Etcheverry
2017-08-17Add closest_power_of_2 func and implement mix_rate/latency on OS XMarcelo Fernandez
2017-08-16Synchronize parameter names in definition and declarationTwistedTwigleg
Fixes #10244.
2017-08-10Removes type information from method bindsIgnacio Etcheverry
2017-07-22Several changes to better run in mobile.Juan Linietsky
2017-05-17Removal of Image from Variant, converted to a Resource.Juan Linietsky
2017-04-08Add "Godot Engine contributors" copyright lineRémi Verschelde
2017-03-24Cache DynamicFont resource for Androidvolzhs
2017-03-05A Whole New World (clang-format edition)Rémi Verschelde
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
2017-02-13Rename the _MD macro to D_METHODHein-Pieter van Braam
This new name also makes its purpose a little clearer This is a step towards fixing #56
2017-02-13Remove use of _SCS from ADD_METHODHein-Pieter van Braam
This saves typing and is a step towards fixing #56
2017-01-16Style: Fix statements ending with ';;'Rémi Verschelde
2017-01-14Style: Fix whole-line commented codeRémi Verschelde
They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
2017-01-14rename String.extension() -> String.get_extension() / String.basename() -> ↵Juan Linietsky
String.get_basename()
2017-01-07Memory pool vectors (DVector) have been enormously simplified in code, and ↵Juan Linietsky
renamed to PoolVector
2017-01-04-Conversion of most properties to a simpler syntax, easier to use by scriptJuan Linietsky
-Modified help to display properties GDScript can still not make use of them, though.
2017-01-02ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky
Variant. All usages of "type" to refer to classes were renamed to "class" ClassDB has been exposed to GDScript. OBJ_TYPE() macro is now GDCLASS()
2017-01-02Merge remote-tracking branch 'origin/gles3' into gles3-on-masterRémi Verschelde
Various merge conflicts have been fixed manually and some mistakes might have been made - time will tell :)
2017-01-01Welcome in 2017, dear changelog reader!Rémi Verschelde
That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
2016-10-03Begining of GLES3 renderer:Juan Linietsky
-Most 2D drawing is implemented -Missing shaders -Missing all 3D -Editor needs to be set on update always to be used, otherwise it does not refresh -Large parts of editor not working
2016-08-02DynamicFont caches now accounts for texture flagsZher Huei Lee
CacheID added for future-proofing
2016-08-02Added extra spacing support for DynamicFontZher Huei Lee
Side effect is that label min-size will now take into account kerning.
2016-08-02Added texture mipmaps and filtering to DynamicFontZher Huei Lee
2016-07-08Remove unused variables (fourth pass) + dead codeRémi Verschelde
Also fix a potential regression from 3fcb9b1ec179b99d979d4cfea9b5e3c80e4a3e33.
2016-06-22Improved binding system (ObjectTypeDB::bind_method) to be friendlier to ↵Juan Linietsky
statically typed languages, should help in the Mono integration. Disabled by default.
2016-06-19Merge pull request #5259 from neikeq/pr-textedit-zoomRémi Verschelde
TextEdit: Change font size with Ctrl+Mouse Wheel Up/Down
2016-06-18DynamicFontData can be built-in (will still link to a ttf though), closes #4600Juan Linietsky
2016-06-18TextEdit: Change font size with Ctrl+Mouse Wheel Up/DownIgnacio Etcheverry
2016-06-18Add missing license headers in our source files (#5255)Rémi Verschelde
Also removes a couple wrong Godot headers from third-party source files.