Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-08-14 18:53:27 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-08-21 20:07:04 +0300
commit34029fc71a3cc7e69f977462d4b3f09eb10ccca2 (patch)
treee92af5b985e31177bba8621e5696e8243b8a2b46 /source/blender/editors
parentabc4beb245c123f570072e642287c44b7c8f2b86 (diff)
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.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_style.c25
1 files changed, 15 insertions, 10 deletions
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);
}
}