Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CJK font #71

Merged
merged 2 commits into from
Dec 2, 2023
Merged

Add CJK font #71

merged 2 commits into from
Dec 2, 2023

Conversation

white-axe
Copy link
Collaborator

Description
This pull request adds Source Han Sans Regular as a fallback font for egui so that Chinese, Japanese and Korean text can be rendered. egui's default font is still used for text that it supports.

The font file is the regular font from "Static Language Specific OTCs" (SourceHanSansOTC.zip) in version 2.004R, which despite its name is one file that contains all languages but only the regular font weight.

Testing
The KNight-Blade example game for RPG Maker XP has a lot of Japanese text in the scripts and event names. It should display now instead of showing as placeholder box characters.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo build --release
  • If applicable, run trunk build --release

@white-axe white-axe requested a review from a team as a code owner December 1, 2023 23:37
@melody-rs
Copy link
Member

What's the licensing on the font?

@white-axe
Copy link
Collaborator Author

SIL Open Font License. It means if the font is embedded into an application like this or embedded in a document or artwork then it can be distributed without attribution or the license, but if the font file itself is distributed then the license has to be distributed with it.

@melody-rs melody-rs merged commit b15d9ce into Astrabit-ST:dev Dec 2, 2023
5 checks passed
@white-axe white-axe deleted the cjk-fonts branch December 2, 2023 16:00
melody-rs pushed a commit to melody-rs/Luminol that referenced this pull request Dec 3, 2023
* feat: add Source Han Sans (for displaying CJK characters)

* perf: compress fonts to reduce binary size
@melody-rs melody-rs added this to the v1.0 milestone Dec 3, 2023
melody-rs added a commit that referenced this pull request Dec 3, 2023
* chore: use universal set of lints across crates

* chore: 🚨 auto-fix most warnings

* chore: disable panic and unwrap lints for now

* chore: 🚨 fix wasily fixable warnings

* refactor(image cache): ♻️ add basic egui texture loader

* fix(image cache): 🐛 handle image load errors semi-gracefully

* fix(image cache): 🐛 clear up the difference between uris and paths

* refactor(image cache): ♻️ drop the use of multiple bind groups for one monolithic bind group

* refactor(graphics): ♻️ remove pervasive passing of push constant support

* fix(tilemap): 🐛 fix various shader and bind group issues

* refactor(tilemap): ♻️ don't pass viewports around constantly

* fix(tilemap): 🐛 fix the collision shader crashing

* refactor: ♻️ remove all uses of retainedimage

* fix(image cache): 🐛 fix loading errors & textures not being srgb

* fix(image cache): 🐛 fix srgb weirdness

* fix(image cache): 🐛 properly unload textures

* refactor(image cache): 🔥 remove TextureLoader and add BytesLoader instead

* refactor: ♻️ Rename atlas cache to atlas loader

* fix: 🚨 fix compile error on wasm

* Add CJK font (#71)

* feat: add Source Han Sans (for displaying CJK characters)

* perf: compress fonts to reduce binary size

* rustfmt

* fix(tilemap): 🐛 fix collision shader on native

I don't know how I missed this, but the collision shader still expected there to be a bind group when we weren't passing one!

---------

Co-authored-by: 刘皓 <[email protected]>
@white-axe white-axe added the enhancement New feature or request label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants