diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-06-03 12:59:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-03 12:59:15 +0200 |
commit | 7460bc36dde3b2975bca69a2d6fe0b0325f1c077 (patch) | |
tree | ed11092faf84e7ff2395ce783b046b833085b89a | |
parent | 3a59c24b51e0b1fe1b3f10e06c7b90acce6c0cf4 (diff) | |
parent | 2919fc73174a3c751405ce46ceed3ef71ea62966 (diff) |
Merge pull request #39130 from Calinou/dynamicfont-disable-outline-antialiasing
Disable antialiasing on the DynamicFont outline as well when requested
-rw-r--r-- | doc/classes/DynamicFontData.xml | 2 | ||||
-rw-r--r-- | scene/resources/dynamic_font.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/doc/classes/DynamicFontData.xml b/doc/classes/DynamicFontData.xml index 2b4ec17bf1..483da96f3f 100644 --- a/doc/classes/DynamicFontData.xml +++ b/doc/classes/DynamicFontData.xml @@ -12,7 +12,7 @@ </methods> <members> <member name="antialiased" type="bool" setter="set_antialiased" getter="is_antialiased" default="true"> - If [code]true[/code], the font is rendered with anti-aliasing. + If [code]true[/code], the font is rendered with anti-aliasing. This property applies both to the main font and its outline (if it has one). </member> <member name="font_path" type="String" setter="set_font_path" getter="get_font_path" default=""""> The path to the vector font file. diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 3b4e4b73f8..3d99556a10 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -567,7 +567,7 @@ DynamicFontAtSize::Character DynamicFontAtSize::_make_outline_char(CharType p_ch if (FT_Glyph_Stroke(&glyph, stroker, 1) != 0) { goto cleanup_glyph; } - if (FT_Glyph_To_Bitmap(&glyph, FT_RENDER_MODE_NORMAL, nullptr, 1) != 0) { + if (FT_Glyph_To_Bitmap(&glyph, font->antialiased ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, nullptr, 1) != 0) { goto cleanup_glyph; } |