Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / interface / interface_style.c
index ed4c766c59644f1c153b8eb1727cb6ad38b8540c..16c3e01e7aa1ed6f6c6703eb6844f2af7818419b 100644 (file)
@@ -524,30 +524,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);
                }
        }