diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-02-14 20:54:50 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-03-25 18:39:37 +0300 |
commit | 9070999c216b87f848dfd9a129b95e3d45a33fb3 (patch) | |
tree | f85a266d1222a3c4fd6aacdc2037a29f5a658dd4 /source/blender/editors/interface/interface_style.c | |
parent | f48d15a86189756ae7dd9b7ba45fb3af24e0846b (diff) |
UI: always use international font
This means Blender can display more text correctly without having to enable
user interface translation. Previously the quality of the font was lower,
but that has been fixed now.
The font files have now been ungzipped, which results in faster file loading
as Freetype can read only the parts of the file that it needs. Blender download
size should not increase since the release package is compressed.
This includes improvements for Cyrillic characters from the latest DejaVu
Sans fonts from D6960, contributed by Harley Acheson. Fixes T74097.
Differential Revision: https://developer.blender.org/D6854
Diffstat (limited to 'source/blender/editors/interface/interface_style.c')
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index fa1f222d27f..8dedce4c361 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -470,15 +470,13 @@ void uiStyleInit(void) uchar *font_ttf = (uchar *)datatoc_bfont_ttf; static int last_font_size = 0; - /* use unicode font for translation */ - if (U.transopts & USER_DOTRANSLATE) { - font_ttf = BLF_get_unifont(&font_size); - - if (!font_ttf) { - /* fall back if not found */ - font_size = datatoc_bfont_ttf_size; - font_ttf = (uchar *)datatoc_bfont_ttf; - } + /* use unicode font if available */ + font_ttf = BLF_get_unifont(&font_size); + + if (!font_ttf) { + /* fall back if not found */ + font_size = datatoc_bfont_ttf_size; + font_ttf = (uchar *)datatoc_bfont_ttf; } /* relload only if needed */ @@ -523,14 +521,12 @@ void uiStyleInit(void) #ifdef WITH_INTERNATIONAL /* use unicode font for text editor and interactive console */ - if (U.transopts & USER_DOTRANSLATE) { - monofont_ttf = BLF_get_unifont_mono(&monofont_size); + monofont_ttf = BLF_get_unifont_mono(&monofont_size); - if (!monofont_ttf) { - /* fall back if not found */ - monofont_size = datatoc_bmonofont_ttf_size; - monofont_ttf = (uchar *)datatoc_bmonofont_ttf; - } + if (!monofont_ttf) { + /* fall back if not found */ + monofont_size = datatoc_bmonofont_ttf_size; + monofont_ttf = (uchar *)datatoc_bmonofont_ttf; } #endif |