crossfont icon indicating copy to clipboard operation
crossfont copied to clipboard

Fonts with mixed normal and colored glyphs are not working properly with fc/core text backend

Open kchibisov opened this issue 5 years ago • 3 comments
trafficstars

We fail to set proper size metrics for not colored glyphs in colored fonts such as https://www.babelstone.co.uk/Fonts/Shapes.html thus all non colored characters fail to redraw.

kchibisov avatar Nov 12 '20 19:11 kchibisov

Could you go into a bit more detail here? Are we talking about the response from the metrics function being incorrect? That should just call out to full_metrics, right? Which doesn't have special handling for colored glyphs as far as I can see.

The only difference we have in metrics for colored glyphs would be in get_rendered_glyph, which affects only the glyph itself. So chances are you mean that here if the face itself is colored, this path is taken for every single glyph even if the individual glyph is not colored? Thus performing bitmap scaling.

chrisduerr avatar Nov 12 '20 21:11 chrisduerr

No, the problem is not metrics but setting sizes for the font, and we do that differently for colored glyphs and normal glyphs, however we make decision about colored glyphs on a font level, and not per glyph basis.

It basically breaks somewhere here https://github.com/alacritty/crossfont/blob/1100c6ebb978a306e9d37db390641b624c9a4561/src/ft/mod.rs#L305 in pair with not calling https://github.com/alacritty/crossfont/blob/1100c6ebb978a306e9d37db390641b624c9a4561/src/ft/mod.rs#L436 . I haven't looked much into it all, since not in the mood to try random freetype things to make it work...

kchibisov avatar Nov 12 '20 21:11 kchibisov

This also affects macOS: https://github.com/alacritty/alacritty/issues/4415.

chrisduerr avatar Nov 13 '20 22:11 chrisduerr