From 2919fc73174a3c751405ce46ceed3ef71ea62966 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. --- 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 2b4ec17bf1c..483da96f3f0 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 3b4e4b73f86..3d99556a10f 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; }