07th-mod / 07th-mod/ui-editing-scripts

Improve Japanese Font Rendering + Fix missing glyphs in msgothic_2

未關閉
#13 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
5
分支
15
PR 合併指標
30 天內沒有已合併 PR

描述

To summarize, some Japanese characters are hard to read in our mod, which could be improved through various means. If w

If we're regenerating the fonts to fix this issue, we might as well also fix the missing glyph in Matsuribayashi (or just make msgothic2 the same set of characters as in msgothic0)

See
- https://github.com/07th-mod/matsuribayashi/issues/41

Below I've copied the previous discussion from discord:

----

**OP:**

> I'm just being extremely picky, but I'm wondering if there's an easy way to change the japanese font. Any moderately complex kanji is always extremely aliased to the point where stroke lines blur together

![image](https://user-images.githubusercontent.com/1249449/204987056-96a5d6bf-3c9f-406a-a7bc-9cd18744dfe6.png)

> I see there's a FontID setting in init.txt, but changing the parameter doesn't seem to do anything with the linux version
for comparison this is DejaVu Sans

![image](https://user-images.githubusercontent.com/1249449/204987082-9b943a9a-c580-45d8-836d-e1bdd0b8944f.png)

> and this is how the character 鷹 looks in umineko

![image](https://user-images.githubusercontent.com/1249449/204987116-5b122f32-a9e6-4587-9bfd-95f30c2c0841.png)

**drojf:**

> Unfortunately, it's kinda difficult....you need to get the font, put it into unity, generate a SDF font in unity, export the font from unity, then run our scripts (for ch1-8 only): https://07th-mod.com/wiki/developer/sharedassets/ui-editing-scripts/#adding-font-support-for-a-new-language-chapters-1-8-only
the fonts are converted to SDF style fonts, so it might just be a quality limitation due to how many characters we can fit in the texture atlas
from the wiki: >The current Japanese font contains about 3000 26pt Japanese characters and fits in 2048x2048, taking up 4MB.

> I'm not sure what the max texture atlas size is in Unity, lemme double check since I was messing with this before...
oh ok, on the version of Unity used on Rei, the max texture atlas size is 8192 (for both dimensions), so we could technically have higher res fonts, but I haven't checked the older versions of unity
I'm not sure if there are any issues having such a large texture, though

**OP (some time later):**

> some fonts look better than others at low res. I have a feeling msgothic is not well optimized. Noto Sans CJK JP is free and open source and might be a better choice. I'd try it myself but I apparently would need to install windows in order to use unity5

![image](https://user-images.githubusercontent.com/1249449/204987209-d361130e-d554-4357-9be5-928b2f3b07f5.png)

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

該 issue 涉及為基於 Unity 的模組生成字型。首先閱讀關於新增字型支援的連結 wiki 頁面 (https://07th-mod.com/wiki/developer/sharedassets/ui-editing-scripts/#adding-font-support-for-a-new-language-chapters-1-8-only)。檢查現有的字型紋理和此儲存庫中的腳本,以理解 SDF 字型生成流程。「完成」意味著生成一個具有改進的日文字形的新字型紋理,並確保其在遊戲中正常運作。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python, unity
領域
game-dev, tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。