From 34029fc71a3cc7e69f977462d4b3f09eb10ccca2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 14 Aug 2018 17:53:27 +0200 Subject: UI: disable new text hinting from D3201 by default for now. This changes the text hinting setting to be an enum with options Auto / None / Slight / Full. The default is Auto which currently disables hinting. The hinting was tested with a new FreeType version, but this is not what is used on the buildbots an official release environment, and the fonts look quite bad because of that. Once FreeType has been upgraded we can change the default. Even then the results are not ideal, perhaps due to missing subpixel positioning and linear color blending support in BLF. --- source/blender/editors/interface/interface_style.c | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/interface/interface_style.c') diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 0257fb0d428..c7ecc37b0bf 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -523,30 +523,35 @@ void uiStyleInit(void) /* Set default flags based on UI preferences (not render fonts) */ { - int flag_enable = 0, flag_disable = 0; - if ((U.text_render & USER_TEXT_DISABLE_HINTING) == 0) { - flag_enable |= BLF_HINTING; + int flag_disable = BLF_MONOCHROME | + BLF_HINTING_NONE | + BLF_HINTING_SLIGHT | + BLF_HINTING_FULL; + int flag_enable = 0; + + if (U.text_render & USER_TEXT_HINTING_NONE) { + flag_enable |= BLF_HINTING_NONE; } - else { - flag_disable |= BLF_HINTING; + else if (U.text_render & USER_TEXT_HINTING_SLIGHT) { + flag_enable |= BLF_HINTING_SLIGHT; + } + else if (U.text_render & USER_TEXT_HINTING_FULL) { + flag_enable |= BLF_HINTING_FULL; } if (U.text_render & USER_TEXT_DISABLE_AA) { flag_enable |= BLF_MONOCHROME; } - else { - flag_disable |= BLF_MONOCHROME; - } for (font = U.uifonts.first; font; font = font->next) { if (font->blf_id != -1) { - BLF_enable(font->blf_id, flag_enable); BLF_disable(font->blf_id, flag_disable); + BLF_enable(font->blf_id, flag_enable); } } if (blf_mono_font != -1) { - BLF_enable(blf_mono_font, flag_enable); BLF_disable(blf_mono_font, flag_disable); + BLF_enable(blf_mono_font, flag_enable); } } -- cgit v1.2.3