This PR uses freetype to fix multiple problems with the current toy API from cairo:
It ensures the font metrics and appearance are consistent between platforms,
It allows to reference a font by path rather by family name, which make the installation simpler and therefore more robust.
Placement of glyphs slightly changes, as we base the ascent of the font on the character set most likely to be used when prototyping. We believe it is better, as it is based on visual properties of the font face.
Finally, this also simplify installation and avoid font problems, as we do not need to copy the fonts anymore, and reference a font face explicitly with an absolute path, rather than relying on font families and variants which might change from one font manager implementation to another.
Note
The outlines of Truetype fonts is not perfect, but since we use them only for stickers, this is good enough.
Fixes #481
Todo:
[x] Make sure freetype dynamic library is installed
This PR uses
freetype
to fix multiple problems with the current toy API from cairo:Placement of glyphs slightly changes, as we base the ascent of the font on the character set most likely to be used when prototyping. We believe it is better, as it is based on visual properties of the font face.
Finally, this also simplify installation and avoid font problems, as we do not need to copy the fonts anymore, and reference a font face explicitly with an absolute path, rather than relying on font families and variants which might change from one font manager implementation to another.
Todo: