mooman219 / fontdue

The fastest font renderer in the world, written in pure rust.
Apache License 2.0
1.44k stars 72 forks source link

Some glyphs are missing coverage data for certain fonts #38

Closed hasenbanck closed 3 years ago

hasenbanck commented 4 years ago

While porting the font renderer for egui to fontdue, I happen to notice that some glyphs are missing the coverage data for a font that egui uses: https://github.com/emilk/egui/blob/master/egui/fonts/Comfortaa-Regular.ttf

For example the glyph for the character 'b' only has a vector with coverage of "0.0"s, but on the other side, the metrics look fine.

Rusttype doesn't seem to have this problem.

mooman219 commented 4 years ago

The font defines half of it's glyphs in TrueType, and the other half in OpenType. Some font viewers will have this issue as well because this is fairly wrong all things considered. I'll see what I can do to support it

mooman219 commented 4 years ago

Upon closer inspection, the letter 'b' is actually not to spec for the font. It's a transform of the letter 'd' which leaves the points incorrectly defined (the order of the points matters, and you can't just mirror a glyph and have it keep working). I'll see what I can do to resolve that, but it's definitely going against the spec for the table the letter is defined in.

I did a little writeup here: https://github.com/RazrFalcon/ttf-parser/issues/43#issuecomment-709567910

mooman219 commented 3 years ago

Fixed