From d56b9d5ebf56a274a7219842b8ef440b8476d650 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 28 May 2020 22:26:16 +0200 Subject: [PATCH] Disable antialiasing on the DynamicFont outline as well when requested This partially addresses https://github.com/godotengine/godot-proposals/issues/943. (cherry picked from commit 2919fc73174a3c751405ce46ceed3ef71ea62966) --- doc/classes/DynamicFontData.xml | 2 +- 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 a742ae53156..eae6db9e2f5 100644 --- a/doc/classes/DynamicFontData.xml +++ b/doc/classes/DynamicFontData.xml @@ -12,7 +12,7 @@ - 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). The path to the vector font file. diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index d19d82d2528..50748ff9213 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -577,7 +577,7 @@ DynamicFontAtSize::Character DynamicFontAtSize::_make_outline_char(CharType p_ch goto cleanup_stroker; if (FT_Glyph_Stroke(&glyph, stroker, 1) != 0) goto cleanup_glyph; - if (FT_Glyph_To_Bitmap(&glyph, FT_RENDER_MODE_NORMAL, 0, 1) != 0) + if (FT_Glyph_To_Bitmap(&glyph, font->antialiased ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, nullptr, 1) != 0) goto cleanup_glyph; glyph_bitmap = (FT_BitmapGlyph)glyph;