Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PSP Font Auto-Generate from TTF
03-01-2014, 04:43 PM (This post was last modified: 03-01-2014 05:01 PM by Bighead.)
Post: #4
RE: PSP Font Auto-Generate from TTF
So I've been digging into the font issue with PPSSPP, and even on the real PSP because custom fonts are doing the same thing. TL;DR, I don't have a solution, but I do have a hypothesis: small fonts are not being created at the correct resolution with current pgf tools. This is purely speculation, so if throughout my post it seems like I know what I'm talking about, I don't.

First, I figured it would be nice to have a table of all of Sony's default fonts. I created this using the problematic game Lunar: Silver Star Story.
http://i.imgur.com/QTu6vZQ.png

Sony's fonts are created for the PSP, and aren't even available to purchase. Even if it was available as a commercial font, expect it to cost anywhere between $40-$100+. This is basically a guarantee that downloading or redistributing these fonts is an act of piracy.

Lunar by default looks for ltn12.pgf before all other fonts. If it doesn't find it, it falls back to ltn4.pgf for some strange reason. Fonts ltn0-ltn7 are all "large" fonts, so you would think it would look for a smaller font between ltn8-ltn15. If it fails to find both ltn12 and ltn4, then it cries mercy and starts counting up from 0 trying to find the next available font.

My next instinct was to compare the size of my custom font ltn12 to Sony's. At the save warning screen, everything looks okay for the most part. Lunar uses only "small" fonts throughout the entire game. Dissidia is using "large" fonts, which do not seem to have an issue. For the most part, large fonts are entirely unaffected, they just need to be created at a font size that looks good, which is not the actual size.
http://i.imgur.com/AWGmgbR.png

I then compared them in game, to both Sony's fonts and and their appearance on the save warning screen. The problem was immediately recognizable, it seems that the fonts are being upscaled to some degree, especially on the Y axis (they look much taller).
http://i.imgur.com/3tVzgZH.png

Sony's fonts don't seem to care they are being upscaled, this is most likely because they are created at a lower pixel resolution. It is probably the fault of all current PGF tools, they are most likely creating all fonts, both large and small, at equal resolutions. This creates a lot of wasted space. And this wasted space is also getting upscaled creating even more waste.
http://i.imgur.com/VAlRT1N.png

To verify my assumptions, I renamed Sony's ltn0.pgf to ltn12.pgf, loaded up Lunar, and it has the same exact issue as all small fonts that are generated with current programs. Basically, only large fonts are being generated by ttf2pgf. Small fonts generated just have a smaller font size than large fonts, but the actual size is the same. And for all I know, the large font size could be incorrect as well. Sony's large font protrudes the text box slightly less than generated custom fonts, but only a very small margin.
http://i.imgur.com/JFP5CJm.png

So the Conclusion: current pgf font tools suck, so there is no way we'll have custom "small" fonts that scale correctly no matter what the face is. They do not account for small fonts, and there is no configurable options to control the output size. Adjusting how "tall" the fonts are does not seem to affect the output, the resolution is most likely fixed whether they are large or small fonts.

There is very little information on the web for the PGF format, there are very little tools, no viewers, editors, etc, and there only seems to be one official tool called libPGF that fails to decode the generated font images. I'm going to continue hunting on the web because there has to be more information than what I currently found, or at least something out there that can correct the aspect ratio of small fonts or at least generate the fonts at the proper size (which I'm not even sure what that is yet).

EDIT: I almost forgot, what this means for the tool I included is that you may want to generate ltn0-7 with different horizontal spacing than ltn8-15. Using a value of 0.25-0.50 can account for some of the "waste" between the fonts, but currently the batch applies the same spacing value to both the large and the (fake) small fonts. I ran out of time for the moment, but I'll update it later so smaller fonts can have a separate spacing value in one run.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
PSP Font Auto-Generate from TTF - Bighead - 02-28-2014, 06:10 PM
RE: PSP Font Auto-Generate from TTF - Bighead - 03-01-2014 04:43 PM

Forum Jump: