At the end of loadsimplefont function in pdf_font.c, when no Widths defined in Font Dict, mupdf tries to construct hmtx from font program. The codes of getting advances of glyphs: 504: else 505: { 506: fterr = FT_Set_Char_Size(face, 1000, 1000, 72, 72); 507: if (fterr) 508: fz_warn("freetype set character size: %s", ft_errorstring(fterr)); 509: for (i = 0; i < 256; i++) 510: { 511: pdf_addhmtx(fontdesc, i, i, ftwidth(fontdesc, i)); 512: } 513: } As descibed in FreeType2 doc, the unit of char_width and char_height in FT_Set_Char_Size is "26.6 fractional points". So, char_width and char_height should be 1000*64, not 1000.
The metrics from ftwidth are not adjusted from fixed point either, so two wrongs make a right in this case. I don't set the character size to 1000*64 because that causes integer overflow problems with some fonts. If you can point me to a specific file that exhibits a bug caused by this, feel free to reopen the bug and attach the PDF.