feat: support multi-region CJK fonts (KR, SC, JP) using native system fonts#8
Conversation
|
Thanks for this fix! The implementation looks solid. One concern: the Noto Sans KR font adds ~15.7 MB to the binary size. Would you be open to trying a system font fallback approach first? For example, on most systems there are already CJK fonts installed:
We could try those as fallbacks before bundling a font. If no system font is available, THEN we could consider bundling a subset or the full font. What do you think? |
|
@OlaProeis #8 (comment) |
|
introduced the font-kit library to enable direct loading of local fonts installed in the OS (e.g. Apple SD Gothic Neo, Malgun Gothic) at runtime. |
|
This is fantastic! Thank you for reworking the PR to use system fonts The multi-region support (Korean, Chinese, Japanese) is a great bonus, and the implementation looks solid with proper fallback handling. One small thing: there's a duplicate test_korean.md in the root directory (the one in test_md/ folder is probably the intended location). Could you remove the root-level one, or should I do it after merge? |
Bug Fixes: - CJK character rendering (#7) - system font fallback (PR #8 by @SteelCrab) - Undo/redo behavior (#5) - scroll, focus, cursor restoration - UTF-8 tree viewer crash - safe string slicing for multi-byte chars - Misleading code folding UI (#12) - hide indicators by default CLI Improvements: - Command-line file opening (#9) - ferrite file.md - Version/help flags (#10) - -V/--version and -h/--help - Configurable log level (#11) - --log-level flag and config setting UX Improvements: - Default view mode setting (#3) - choose Raw/Rendered/Split for new tabs Performance: - Large file editing - deferred syntax highlighting - Scroll performance - galley caching for instant colors Docs: - CLI reference (docs/cli.md) - Technical docs for log level, default view mode, code folding UI
Bug Fixes: - CJK character rendering (#7) - system font fallback (PR #8 by @SteelCrab) - Undo/redo behavior (#5) - scroll, focus, cursor restoration - UTF-8 tree viewer crash - safe string slicing for multi-byte chars - Misleading code folding UI (#12) - hide indicators by default CLI Improvements: - Command-line file opening (#9) - ferrite file.md - Version/help flags (#10) - -V/--version and -h/--help - Configurable log level (#11) - --log-level flag and config setting UX Improvements: - Default view mode setting (#3) - choose Raw/Rendered/Split for new tabs Performance: - Large file editing - deferred syntax highlighting - Scroll performance - galley caching for instant colors Docs: - CLI reference (docs/cli.md) - Technical docs for log level, default view mode, code folding UI
Description
Add Korean/CJK character support with Noto Sans KR fallback font.
Fixes #7
Type of Change
Changes Made
NotoSansKR-Regular.ttfas fallback font for Korean characterssrc/fonts.rsChecklist
cargo fmt- no changescargo clippy- no warningscargo build --release- success