Use Noto fonts for Arabic, Hebrew and Thai
This commit is contained in:
parent
412afe42e7
commit
30f4a16cdf
7 changed files with 28 additions and 30 deletions
|
@ -64,12 +64,12 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_valign, int p
|
|||
return font;
|
||||
}
|
||||
|
||||
#define MAKE_FALLBACKS(m_name) \
|
||||
m_name->add_fallback(DroidSansFallback); \
|
||||
m_name->add_fallback(DroidSansJapanese); \
|
||||
m_name->add_fallback(DroidSansArabic); \
|
||||
m_name->add_fallback(DroidSansHebrew); \
|
||||
m_name->add_fallback(DroidSansThai);
|
||||
#define MAKE_FALLBACKS(m_name) \
|
||||
m_name->add_fallback(FontArabic); \
|
||||
m_name->add_fallback(FontHebrew); \
|
||||
m_name->add_fallback(FontThai); \
|
||||
m_name->add_fallback(FontJapanese); \
|
||||
m_name->add_fallback(FontFallback);
|
||||
|
||||
#define MAKE_DEFAULT_FONT(m_name, m_size) \
|
||||
Ref<DynamicFont> m_name; \
|
||||
|
@ -86,30 +86,30 @@ void editor_register_fonts(Ref<Theme> p_theme) {
|
|||
DefaultFont->set_font_ptr(_font_NotoSansUI_Regular, _font_NotoSansUI_Regular_size);
|
||||
DefaultFont->set_force_autohinter(true); //just looks better..i think?
|
||||
|
||||
Ref<DynamicFontData> DroidSansFallback;
|
||||
DroidSansFallback.instance();
|
||||
DroidSansFallback->set_font_ptr(_font_DroidSansFallback, _font_DroidSansFallback_size);
|
||||
DroidSansFallback->set_force_autohinter(true); //just looks better..i think?
|
||||
Ref<DynamicFontData> FontFallback;
|
||||
FontFallback.instance();
|
||||
FontFallback->set_font_ptr(_font_DroidSansFallback, _font_DroidSansFallback_size);
|
||||
FontFallback->set_force_autohinter(true); //just looks better..i think?
|
||||
|
||||
Ref<DynamicFontData> DroidSansJapanese;
|
||||
DroidSansJapanese.instance();
|
||||
DroidSansJapanese->set_font_ptr(_font_DroidSansJapanese, _font_DroidSansJapanese_size);
|
||||
DroidSansJapanese->set_force_autohinter(true); //just looks better..i think?
|
||||
Ref<DynamicFontData> FontJapanese;
|
||||
FontJapanese.instance();
|
||||
FontJapanese->set_font_ptr(_font_DroidSansJapanese, _font_DroidSansJapanese_size);
|
||||
FontJapanese->set_force_autohinter(true); //just looks better..i think?
|
||||
|
||||
Ref<DynamicFontData> DroidSansArabic;
|
||||
DroidSansArabic.instance();
|
||||
DroidSansArabic->set_font_ptr(_font_DroidSansArabic, _font_DroidSansArabic_size);
|
||||
DroidSansArabic->set_force_autohinter(true); //just looks better..i think?
|
||||
Ref<DynamicFontData> FontArabic;
|
||||
FontArabic.instance();
|
||||
FontArabic->set_font_ptr(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size);
|
||||
FontArabic->set_force_autohinter(true); //just looks better..i think?
|
||||
|
||||
Ref<DynamicFontData> DroidSansHebrew;
|
||||
DroidSansHebrew.instance();
|
||||
DroidSansHebrew->set_font_ptr(_font_DroidSansHebrew, _font_DroidSansHebrew_size);
|
||||
DroidSansHebrew->set_force_autohinter(true); //just looks better..i think?
|
||||
Ref<DynamicFontData> FontHebrew;
|
||||
FontHebrew.instance();
|
||||
FontHebrew->set_font_ptr(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size);
|
||||
FontHebrew->set_force_autohinter(true); //just looks better..i think?
|
||||
|
||||
Ref<DynamicFontData> DroidSansThai;
|
||||
DroidSansThai.instance();
|
||||
DroidSansThai->set_font_ptr(_font_DroidSansThai, _font_DroidSansThai_size);
|
||||
DroidSansThai->set_force_autohinter(true); //just looks better..i think?
|
||||
Ref<DynamicFontData> FontThai;
|
||||
FontThai.instance();
|
||||
FontThai->set_font_ptr(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size);
|
||||
FontThai->set_force_autohinter(true); //just looks better..i think?
|
||||
|
||||
/* Source Code Pro */
|
||||
|
||||
|
|
6
thirdparty/README.md
vendored
6
thirdparty/README.md
vendored
|
@ -17,15 +17,13 @@ TODO.
|
|||
|
||||
## fonts
|
||||
|
||||
### Noto Sans UI Regular
|
||||
### Noto Sans
|
||||
|
||||
- Upstream: https://github.com/googlei18n/noto-fonts
|
||||
- Version: 1.06
|
||||
- License: OFL-1.1
|
||||
|
||||
#### What’s the difference between the UI and non-UI versions?
|
||||
The UI fonts were initially prepared for use in Android’s UI. They have tighter vertical metrics, and some glyphs that would be clipped are redrawn to fit within the constrained space. They can be used anywhere that has limited vertical space. There are no UI verions of scripts that do not need such adjustment, and the non-UI versions should be preferred for use in body text.
|
||||
https://github.com/googlei18n/noto-fonts/blob/master/FAQ.md#whats-the-difference-between-the-ui-and-non-ui-versions
|
||||
Use UI font if exists, because it has tight vertial metrix and good for UI.
|
||||
|
||||
### Adobe Source Code Pro Regular
|
||||
|
||||
|
|
BIN
thirdparty/fonts/DroidSansArabic.ttf
vendored
BIN
thirdparty/fonts/DroidSansArabic.ttf
vendored
Binary file not shown.
BIN
thirdparty/fonts/DroidSansHebrew.ttf
vendored
BIN
thirdparty/fonts/DroidSansHebrew.ttf
vendored
Binary file not shown.
BIN
thirdparty/fonts/NotoNaskhArabicUI_Regular.ttf
vendored
Normal file
BIN
thirdparty/fonts/NotoNaskhArabicUI_Regular.ttf
vendored
Normal file
Binary file not shown.
BIN
thirdparty/fonts/NotoSansHebrew_Regular.ttf
vendored
Normal file
BIN
thirdparty/fonts/NotoSansHebrew_Regular.ttf
vendored
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue