-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow specifying font index when loading a font file #853
Comments
If you could specify the face index in |
Yes, I think add a Considering compatibility, a default value of 0 can be used when the index cannot be found in this field. |
It seems |
|
Thank you! I can try this pr tonight, after work |
When using a custom font you can now specify a font index Closes #853
I try to let my egui app to use system font.
I can use some font query/loading library to find the font location and read it as binary data, however, it's a ttc file(for example, Microsoft YaHei), so egui report the data a invalid when parsing.
It seems ab_glyph do support collection, by using FontRef::try_from_slice_and_index, so any idea how can I use ttc/otc ffont file as custom font in egui?
update
Maybe there is some bug in the font loading library I used.
I changed from font-loader to fontdb, and now it's working, no
invalid font
report.But, IIRC, font loading library gives whole file content, and because I can't pass the font face index to egui, current it will always using the font face at index 0, which means when using ttc/otf, the render result may not be as expected.
For example, Helvetica Neue(Normal style) is in index 10
The text was updated successfully, but these errors were encountered: