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 Korean Font to embedded-graphics #633

Open
jjpark78 opened this issue Dec 19, 2021 · 3 comments
Open

add Korean Font to embedded-graphics #633

jjpark78 opened this issue Dec 19, 2021 · 3 comments

Comments

@jjpark78
Copy link

is embedded-graphics support add CJK language fonts ?

if so, is there a tutorial or documents about it ?

@jamwaffles
Copy link
Member

I believe it could be added as long as Korean is written left-to-right - we don't currently support RTL text unfortunately. All the builtin fonts are generated from the BDF files here so if some or all of those support the Korean character set, it could be added.

There's no tutorial, but a starting point would be the convert-fonts command in the Justfile which runs tools/convert-fonts/src/main.rs. I believe this uses the mappings defined in the impl_mapping! macro in src/mono_font/mapping.rs if you wanted to take a look at implementing it yourself.

If the source fonts don't support Korean characters or some other issue comes up, I'd suggest making a separate crate with any required features to better support Korean

@ferristseng
Copy link

I'm working on some mono fonts for Chinese, but could easily add Korean. See: https://github.com/ferristseng/rust-embedded-graphics-cjk

Feel free to open an issue there! I may need some help since I don't speak Korean :)

@flyingyizi
Copy link

flyingyizi commented Oct 29, 2022

embedded-fonts may be your wanted. This project includes a small tool convert-bdf to split(optional) and convert the BDF file format into the internal data structure for text render by the [embedded-graphics] library. usage refer the https://github.com/flyingyizi/embedded-fonts/examples.

you also can use ttf and pcf fonts. how to convert them to bdf is written in the readme.

With this crate, you can only import the required glyphs into your project. For example, only 35 characters "中国欢迎China welcomes日本へようこそWelcome to Japan북한 환영Welcome North Korea" are introduced, which is very meaningful in MCUs with limited space, such as avr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants