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 | |
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
-rw-r--r-- | release/datafiles/LICENSE-bmonofont-i18n.ttf.txt | 3 | ||||
-rw-r--r-- | release/datafiles/LICENSE-droidsans.ttf.txt | 3 | ||||
-rw-r--r-- | release/datafiles/fonts/bmonofont-i18n.ttf | bin | 0 -> 5571264 bytes | |||
-rw-r--r-- | release/datafiles/fonts/bmonofont-i18n.ttf.gz | bin | 2686344 -> 0 bytes | |||
-rw-r--r-- | release/datafiles/fonts/droidsans.ttf | bin | 0 -> 5695208 bytes | |||
-rw-r--r-- | release/datafiles/fonts/droidsans.ttf.gz | bin | 2436926 -> 0 bytes | |||
-rw-r--r-- | source/blender/blenfont/intern/blf_font_i18n.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 28 |
8 files changed, 20 insertions, 18 deletions
diff --git a/release/datafiles/LICENSE-bmonofont-i18n.ttf.txt b/release/datafiles/LICENSE-bmonofont-i18n.ttf.txt index d972108816b..20ed51c8252 100644 --- a/release/datafiles/LICENSE-bmonofont-i18n.ttf.txt +++ b/release/datafiles/LICENSE-bmonofont-i18n.ttf.txt @@ -8,6 +8,9 @@ Blender Mono I18n font includes glyphs imported from the following fonts: These were merged using FontForge in the above order. For each glyph, a license of the font from which it was imported is applied. +Feb 2020 - Cyrillic unicode range (specifically U+400-U+0525) reimported +from current version of DejaVu Sans Mono. + ---------------------------------------------------------------------- Summary of Copyrights and Licenses diff --git a/release/datafiles/LICENSE-droidsans.ttf.txt b/release/datafiles/LICENSE-droidsans.ttf.txt index 6711ad37338..66eca9ca715 100644 --- a/release/datafiles/LICENSE-droidsans.ttf.txt +++ b/release/datafiles/LICENSE-droidsans.ttf.txt @@ -12,6 +12,9 @@ Blender Main I18n font ("droidsans.ttf") includes glyphs imported from the follo These were merged using FontForge in (approximately) the above order. For each glyph, a license of the font from which it was imported is applied. +Feb 2020 - Cyrillic unicode range (specifically U+400-U+0525) reimported +from current version of DejaVu Sans + ---------------------------------------------------------------------- Summary of Copyrights and Licenses diff --git a/release/datafiles/fonts/bmonofont-i18n.ttf b/release/datafiles/fonts/bmonofont-i18n.ttf Binary files differnew file mode 100644 index 00000000000..658ec68f36c --- /dev/null +++ b/release/datafiles/fonts/bmonofont-i18n.ttf diff --git a/release/datafiles/fonts/bmonofont-i18n.ttf.gz b/release/datafiles/fonts/bmonofont-i18n.ttf.gz Binary files differdeleted file mode 100644 index 2c3e00d1c75..00000000000 --- a/release/datafiles/fonts/bmonofont-i18n.ttf.gz +++ /dev/null diff --git a/release/datafiles/fonts/droidsans.ttf b/release/datafiles/fonts/droidsans.ttf Binary files differnew file mode 100644 index 00000000000..04b1ece64ee --- /dev/null +++ b/release/datafiles/fonts/droidsans.ttf diff --git a/release/datafiles/fonts/droidsans.ttf.gz b/release/datafiles/fonts/droidsans.ttf.gz Binary files differdeleted file mode 100644 index 858264142f1..00000000000 --- a/release/datafiles/fonts/droidsans.ttf.gz +++ /dev/null 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 |