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
This commit is contained in:
Brecht Van Lommel 2020-02-14 18:54:50 +01:00 committed by Brecht Van Lommel
parent f48d15a861
commit 9070999c21
Notes: blender-bot 2023-02-14 06:00:46 +01:00
Referenced by issue #74097, Blender show cyrillic capital letter «Ё» as «Е»
8 changed files with 19 additions and 17 deletions

View File

@ -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

View File

@ -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

Binary file not shown.

Binary file not shown.

View File

@ -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)
{

View File

@ -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);
/* 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;
}
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