I've been looking into a problem experienced by a Pygame user when trying to work with certain monospaced fonts, where it was observed that different glyphs varied in width by up to 2 pixels. Pygame uses SDL_ttf which in turn uses FreeType for handling text rendering.
You can see the discussion and investigation where it was reported here: https://bugs.launchpad.net/ubuntu/+source/ttf-freefont/+bug/1001033 As far as I can tell, the problem only appears in FreeType version 2.4.5 and later, because old versions detected monospaced fonts and forced the advance width of all glyphs to advance_Width_Max. As I understand it, this behaviour was removed in commit 8c82ec5b17d0cfc9b0876a2d848acc207a62a25a due to problems with CJK fonts. Also, it only occurs in certain fonts. It affects the FreeMono in this bundle: http://ftp.gnu.org/gnu/freefont/freefont-ttf-20100919.tar.gz but not the one in this bundle: http://ftp.gnu.org/gnu/freefont/freefont-ttf-20090104.tar.gz I think perhaps one includes hinting information and the other doesn't? I'm not sure there. Is this expected? Should autohinting on a monospaced font result in some glyphs having different advance widths? It seems surprising, but to be honest I don't know an awful lot about text rendering, so I'm not sure what to expect. _______________________________________________ Freetype mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/freetype
