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

Please add ? and ◻ for font loaders that expect a glyph to represent "missing" #1600

Closed
sowbug opened this issue Nov 3, 2023 · 2 comments

Comments

@sowbug
Copy link

sowbug commented Nov 3, 2023

See emilk/egui#3526 for context. If a library loads a .ttf, it might load and cache ◻ or ? to have something to display when a glyph is missing. Unfortunately, the Material Icons TTF files don't include either of those glyphs, so the loading code crashes. While I'd say this is more of a bug in the library than in the TTF, I concede that it's extraordinary for a font family to have no representation of ◻, and especially ?, so I speculate that this particular library code isn't the only one failing to load this font.

Thanks!

@tphinney
Copy link
Collaborator

tphinney commented Nov 3, 2023

Fonts generally have a glyph called “.notdef” which is intended for fallback when some desired character is missing. That is: for EXACTLY this purpose.

Usually it takes the form of a rectangular box, often with something in it, which is sometimes a question mark… or an X that goes right to the borders of the box.

Material Symbols has a .notdef

So I am not immediately inclined to start adding support for arbitrary non-standard fallback characters... just not sure where that ends, and there is an obvious answer of: use the standard thing.

@sowbug
Copy link
Author

sowbug commented Nov 3, 2023

I did not know about that! I will see about enhancing the egui library to teach it about notdef. Thanks!

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

2 participants