hrydgard/ppsspp — pull request #1688 by unknownbrackets (2013-05-05 20:02:37+00:00)
Title: Improve font matching in sceFontFindOptimumFont()

This seems to match correctly per my tests. I don't know if the other parameters matter, because at least on my PSP I don't have anything that has diferent values for those parameters to test with.

This makes text look slightly less ugly in Lunar, which is now picking the right font, al thoug h, it 'sst ill got probl ems, and it's still too big.

But initially, it looks like the size issue might actually be the font, afaict (but maybe I'm wrong), because the font info from my PSP:

Font Info: maxGlyphWidthI: 1006, maxGlyphHeightI: 865, maxGlyphAscenderI: 576, maxGlyphDescenderI: -131, maxGlyphLeftXI: 124, maxGlyphBaseYI: 847, minGlyphCenterXI: -503, maxGlyphTopYI: 12, maxGlyphAdvanceXI: 1084, maxGlyphAdvanceYI: 730, maxGlyphWidthF: 15.718750, maxGlyphHeightF: 13.515625, maxGlyphAscenderF: 9.000000, maxGlyphDescenderF: -2.046875, maxGlyphLeftXF: 1.937500, maxGlyphBaseYF: 13.234375, minGlyphCenterXF: -7.859375, maxGlyphTopYF: 0.187500, maxGlyphAdvanceXF: 16.937500, maxGlyphAdvanceYF: 11.406250, maxGlyphWidth: 17, maxGlyphHeight: 15, charMapLength: 324, shadowMapLength: 0, BPP: 4
Font Style: h=7.000000 (128.000000), v=7.000000 (128.000000), w=0.000000, family=1, style=5 / 0, lang=2, reg=0, country=1, name=FTT-NewRodin Pro Latin, file=ltn12.pgf, attr=00000000, exp=0

Looks pretty different from PPSSPP:

Font Info: maxGlyphWidthI: 1455, maxGlyphHeightI: 1222, maxGlyphAscenderI: 863, maxGlyphDescenderI: -196, maxGlyphLeftXI: 195, maxGlyphBaseYI: 1202, minGlyphCenterXI: -727, maxGlyphTopYI: 18, maxGlyphAdvanceXI: 1585, maxGlyphAdvanceYI: 1094, maxGlyphWidthF: 22.734375, maxGlyphHeightF: 19.093750, maxGlyphAscenderF: 13.484375, maxGlyphDescenderF: -3.062500, maxGlyphLeftXF: 3.046875, maxGlyphBaseYF: 18.781250, minGlyphCenterXF: -11.359375, maxGlyphTopYF: 0.281250, maxGlyphAdvanceXF: 24.765625, maxGlyphAdvanceYF: 17.093750, maxGlyphWidth: 23, maxGlyphHeight: 20, charMapLength: 8774, shadowMapLength: 0, BPP: 4
Font Style: h=7.000000 (128.000000), v=7.000000 (128.000000), w=0.000000, family=1, style=5 / 0, lang=2, reg=0, country=1, name=FTT-NewRodin Pro Latin, file=ltn12.pgf, attr=00000000, exp=0

1222 (max height) is a larger number than 865 (significantly so.) Also interesting that the charMapLength value is so different.

I'd swear I saw some tool somewhere to generate a PGF from a ttf... not sure where it was again?

-[Unknown]