Add IBM Plex JP font

This commit is contained in:
scawful
2023-08-26 12:18:14 -04:00
parent 559c2e4830
commit c788f92c20
2 changed files with 6 additions and 2 deletions

Binary file not shown.

View File

@@ -222,6 +222,7 @@ absl::Status Controller::CreateGuiContext() const {
static const char *COUSINE_REGULAR = "assets/font/Cousine-Regular.ttf"; static const char *COUSINE_REGULAR = "assets/font/Cousine-Regular.ttf";
static const char *DROID_SANS = "assets/font/DroidSans.ttf"; static const char *DROID_SANS = "assets/font/DroidSans.ttf";
static const char *NOTO_SANS_JP = "assets/font/NotoSansJP.ttf"; static const char *NOTO_SANS_JP = "assets/font/NotoSansJP.ttf";
static const char *IBM_PLEX_JP = "assets/font/IBMPlexSansJP-Bold.ttf";
static const float FONT_SIZE_DEFAULT = 14.0f; static const float FONT_SIZE_DEFAULT = 14.0f;
static const float FONT_SIZE_DROID_SANS = 16.0f; static const float FONT_SIZE_DROID_SANS = 16.0f;
static const float ICON_FONT_SIZE = 18.0f; static const float ICON_FONT_SIZE = 18.0f;
@@ -237,10 +238,13 @@ absl::Status Controller::CreateGuiContext() const {
// Japanese font configuration // Japanese font configuration
ImFontConfig japanese_font_config; ImFontConfig japanese_font_config;
japanese_font_config.MergeMode = true; japanese_font_config.MergeMode = true;
icons_config.GlyphOffset.y = 5.0f;
icons_config.GlyphMinAdvanceX = 13.0f;
icons_config.PixelSnapH = true;
// List of fonts to be loaded // List of fonts to be loaded
std::vector<const char *> font_paths = {KARLA_REGULAR, ROBOTO_MEDIUM, std::vector<const char *> font_paths = {KARLA_REGULAR, ROBOTO_MEDIUM,
COUSINE_REGULAR, DROID_SANS}; COUSINE_REGULAR, IBM_PLEX_JP};
// Load fonts with associated icon and Japanese merges // Load fonts with associated icon and Japanese merges
for (const auto &font_path : font_paths) { for (const auto &font_path : font_paths) {
@@ -257,7 +261,7 @@ absl::Status Controller::CreateGuiContext() const {
&icons_config, icons_ranges); &icons_config, icons_ranges);
// Merge Japanese font // Merge Japanese font
io.Fonts->AddFontFromFileTTF(NOTO_SANS_JP, font_size, &japanese_font_config, io.Fonts->AddFontFromFileTTF(NOTO_SANS_JP, 18.0f, &japanese_font_config,
io.Fonts->GetGlyphRangesJapanese()); io.Fonts->GetGlyphRangesJapanese());
} }