[Bf-blender-cvs] [9070999c216] master: UI: always use international font

Brecht Van Lommel noreply at git.blender.org
Wed Mar 25 16:46:00 CET 2020


Commit: 9070999c216b87f848dfd9a129b95e3d45a33fb3
Author: Brecht Van Lommel
Date:   Fri Feb 14 18:54:50 2020 +0100
Branches: master
https://developer.blender.org/rB9070999c216b87f848dfd9a129b95e3d45a33fb3

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

===================================================================

M	release/datafiles/LICENSE-bmonofont-i18n.ttf.txt
M	release/datafiles/LICENSE-droidsans.ttf.txt
A	release/datafiles/fonts/bmonofont-i18n.ttf
D	release/datafiles/fonts/bmonofont-i18n.ttf.gz
A	release/datafiles/fonts/droidsans.ttf
D	release/datafiles/fonts/droidsans.ttf.gz
M	source/blender/blenfont/intern/blf_font_i18n.c
M	source/blender/editors/interface/interface_style.c

===================================================================

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
new file mode 100644
index 00000000000..658ec68f36c
Binary files /dev/null and b/release/datafiles/fonts/bmonofont-i18n.ttf differ
diff --git a/release/datafiles/fonts/bmonofont-i18n.ttf.gz b/release/datafiles/fonts/bmonofont-i18n.ttf.gz
deleted file mode 100644
index 2c3e00d1c75..00000000000
Binary files a/release/datafiles/fonts/bmonofont-i18n.ttf.gz and /dev/null differ
diff --git a/release/datafiles/fonts/droidsans.ttf b/release/datafiles/fonts/droidsans.ttf
new file mode 100644
index 00000000000..04b1ece64ee
Binary files /dev/null and b/release/datafiles/fonts/droidsans.ttf differ
diff --git a/release/datafiles/fonts/droidsans.ttf.gz b/release/datafiles/fonts/droidsans.ttf.gz
deleted file mode 100644
index 858264142f1..00000000000
Binary files a/release/datafiles/fonts/droidsans.ttf.gz and /dev/null differ
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



More information about the Bf-blender-cvs mailing list