Repository navigation
Conversation
…ority by language
Previously, Japanese UI text was rendered using SourceHanSansSC (a Simplified Chinese
font), causing Japanese characters to appear in Chinese glyph variants. Additionally,
the meter font (Cascadia Mono) used a terminal-style Japanese font (CascadiaNextJP)
that resulted in wide, thin kana and kanji that clashed with the English text style.
Changes:
- Add BIZUDPGothic-Regular.ttf as an embedded font resource
- Use BIZ UDP Gothic (SIL Open Font License) as the Japanese font, merged at 13.5f to
match the cap-height of Segoe UI (18f) and Cascadia Mono (18f)
- Enable GlyphOffset support in FontFile.BindToImGui() for baseline alignment
- Make CJK font merge order language-sensitive in both LoadFonts() calls:
- Language ja: BIZ UDP Gothic merged first (Japanese glyph variants take priority),
Source Han Sans SC as fallback
- All other languages (zh, en, etc.): Source Han Sans SC merged first (Simplified
Chinese glyph variants take priority), BIZ UDP Gothic as fallback
- Apply the same priority logic to the Cascadia-Mono meter font merge
- Add missing using BPSR_ZDPS.DataTypes directive to OffscreenImGuiRenderer.cs
Note: font priority is evaluated once at startup; a restart is required after changing
the language setting for the new font order to take effect.
|
Can you please provide example text along with screenshots of before and after the change to demonstrate it? |
|
Is it possible to use a monospace version of this font? There are two types of fonts currently used throughout ZDPS, Monospace and Proportional. Monospace fonts are used in select areas to provide consistent UI spacing and allow calculation shortcuts to improve performance without risking inconsistent UI spacing. The Proportional fonts are used in the rest of ZDPS when we don't need to worry about the consistent spacing or performance optimizations as much and want to provide a smoother reading experience in large quantities of text such as the Settings menu. Your changes are currently using this Proportional font in both Monospace and Proportional atlases. |
BIZUDPGothic-Regular.ttf (proportional) was incorrectly being merged into the Cascadia-Mono monospace atlas for Japanese glyphs. Other CJK languages consistently use their monospace counterparts (CascadiaNextSC, CascadiaNextTC, D2Coding) in this atlas. Changes: - Add BIZUDGothic-Regular.ttf as an embedded font resource - Use BIZUDGothic-Regular.ttf (monospace) instead of BIZUDPGothic-Regular.ttf (proportional) when merging Japanese glyphs into the Cascadia-Mono atlas, in both Program.cs and OffscreenImGuiRenderer.cs - BIZUDPGothic-Regular.ttf (proportional) remains in use for the Segoe proportional atlas, as intended




Summary of Changes
This PR improves Japanese text rendering across the UI and damage meter while ensuring existing Chinese glyph variants remain intact for non-Japanese users.
1. Replaced Japanese Fallback Font
BIZUDPGothic-Regular.ttf, SIL Open Font License by Morisawa) as an embedded resource.GlyphOffsetassignment inFontFile.BindToImGui()for proper baseline alignment.2. Language-Sensitive CJK Glyph Priority
Because ImGui resolves glyph collisions using the first-loaded font:
Language == "ja":BIZ UDP Gothicis merged first (Japanese glyph variants take priority), withSourceHanSansSC/CascadiaNextSCas fallback for remaining Chinese-only glyphs.zh,en, etc.):SourceHanSansSC/CascadiaNextSCare merged first (Simplified Chinese glyph variants take priority), withBIZ UDP Gothicas fallback for kana and remaining glyphs.3. Renderer & Module Consistency
Program.csandOffscreenImGuiRenderer.cs.using BPSR_ZDPS.DataTypes;toOffscreenImGuiRenderer.cs.