Disable antialiasing on the DynamicFont outline as well when requested

This partially addresses
https://github.com/godotengine/godot-proposals/issues/943.
This commit is contained in:
Hugo Locurcio 2020-05-28 22:26:16 +02:00
parent 105bef19ff
commit 2919fc7317
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@
</methods> </methods>
<members> <members>
<member name="antialiased" type="bool" setter="set_antialiased" getter="is_antialiased" default="true"> <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>
<member name="font_path" type="String" setter="set_font_path" getter="get_font_path" default="&quot;&quot;"> <member name="font_path" type="String" setter="set_font_path" getter="get_font_path" default="&quot;&quot;">
The path to the vector font file. The path to the vector font file.

View file

@ -567,7 +567,7 @@ DynamicFontAtSize::Character DynamicFontAtSize::_make_outline_char(CharType p_ch
if (FT_Glyph_Stroke(&glyph, stroker, 1) != 0) { if (FT_Glyph_Stroke(&glyph, stroker, 1) != 0) {
goto cleanup_glyph; 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; goto cleanup_glyph;
} }