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

Font support for unicode characters? #678

Open
riimi opened this issue Aug 14, 2019 · 3 comments
Open

Font support for unicode characters? #678

riimi opened this issue Aug 14, 2019 · 3 comments
Milestone

Comments

@riimi
Copy link

riimi commented Aug 14, 2019

Hi! I am new to engo, into it these days.
I have been trying to draw a string containing unicode characters: Korean, Chinese, Japanese.
Do I have to implement a new shader for this?
Thanks in advance!

@Noofbiz
Copy link
Member

Noofbiz commented Aug 15, 2019

The font shader should be able to handle it, but right now it's limited to the first 200 glyphs from the font here. This is so that generating a font atlas happens quickly and gets everything you need, but also because I've never taken the time to use fonts containing those characters. I think the easiest fix would be to allow users to set the number of Glyphs used, and have it default to 200 if they don't.

@Noofbiz Noofbiz added this to the 1.1 milestone Aug 15, 2019
@riimi
Copy link
Author

riimi commented Aug 20, 2019

I solved the problem by increasing UnicodeCap according to your advice. But, the solution seems inefficient way because the font makes the big font atlas starting from index 0. I think I will have to find more efficient way to support multiple languages.

@Noofbiz
Copy link
Member

Noofbiz commented Aug 20, 2019

Yeah I'm thinking of adding to fonts a []int that will let you decide which code points are used. If empty it'll do 0-200 for backwards compatibility. I think this is best because then if you only need 8 characters it'll only make 8 characters and not waste memory on the other ones.

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

No branches or pull requests

2 participants