Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.psf files seem to be wrong #112

Open
justus2510 opened this issue Sep 21, 2023 · 1 comment
Open

.psf files seem to be wrong #112

justus2510 opened this issue Sep 21, 2023 · 1 comment

Comments

@justus2510
Copy link

The .psf file seems to be twice as wide as it actually should be. The PSF header also reports cozette.psf to be of size 12x13 when it should be 6x13.

The glyphs look like this (I wrote a quick program that extracts the glyphs and prints them out in ASCII):

image

You can also easily confirm this by opening cozette.psf in a hex editor and looking at bytes 28-32, which is the width of each glyph as an unsigned 32-bit integer.

The problem seems to be that the input file gets misinterpreted somehow. This command reproduces the error:
java -jar BitsNPicas.jar convertbitmap -f psf2 -o BAD.psf cozette.bdf
Same thing happens with the .sfd file. I couldn't test .otf because BitsNPicas doesn't seem to accept it. The .dfont file just straight up crashes.

However, if you use the .fnt file instead, it's at least a little better, with the font now being reported at 7x14:
java -jar BitsNPicas.jar convertbitmap -f psf2 -o BETTER.psf cozette.fnt

If I understand correctly (from briefly looking at build.py), the .psf file is built from the .bdf file through fontforge. I unfortunately can't get fontforge to work at all, so I can't test anything related to that. But my guess is that fontforge is having the same problem as BitsNPicas.

@Marie-Joseph
Copy link

I generated bdf files from the sdf file using fontforge and still got the wrong widths. If I knew more about the file format, I'd try to fix the issue by hand, but alas I have no idea how any of these file formats work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants