From 9070999c216b87f848dfd9a129b95e3d45a33fb3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 14 Feb 2020 18:54:50 +0100 Subject: 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 --- source/blender/blenfont/intern/blf_font_i18n.c | 4 ++-- source/blender/editors/interface/interface_style.c | 28 ++++++++++------------ 2 files changed, 14 insertions(+), 18 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenfont/intern/blf_font_i18n.c b/source/blender/blenfont/intern/blf_font_i18n.c index 74113ae4ce1..caacd6a28db 100644 --- a/source/blender/blenfont/intern/blf_font_i18n.c +++ b/source/blender/blenfont/intern/blf_font_i18n.c @@ -45,8 +45,8 @@ struct FontBuf { int data_len; }; -static struct FontBuf unifont_ttf = {"droidsans.ttf.gz"}; -static struct FontBuf unifont_mono_ttf = {"bmonofont-i18n.ttf.gz"}; +static struct FontBuf unifont_ttf = {"droidsans.ttf"}; +static struct FontBuf unifont_mono_ttf = {"bmonofont-i18n.ttf"}; static void fontbuf_load(struct FontBuf *fb) { 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 -- cgit v1.2.3