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

Improve Japanese Font Rendering + Fix missing glyphs in msgothic_2

オープン
#13 コメント 2 件 リアクション 0 件 担当者 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 ベースの mod のフォント生成に関するものです。まず、リンクされているフォントサポート追加に関する 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 を短くまとめたダイジェスト。