slavfox / Cozette

A bitmap programming font optimized for coziness 💜
MIT License
2.84k stars 42 forks source link

Inconsistent character widths in vector font #55

Closed Haspaker closed 1 year ago

Haspaker commented 3 years ago

The vector version of the font, CozetteVector, does not appear to be entirely fixed width. Some characters, such as the pause symbol (U+F04C) and the circled plus symbol (U+F055) have a smaller width, leading to misalignment (as clearly seen in the last column of the image below).

Misaligned

I don't know much about fonts or FontForge, but I noticed that all the offending characters declare an unusual Width in the Cozette.sfd file (945 instead of 1024).

StartChar: uniF04C
Encoding: 61516 61516 1123
Width: 945
Flags: W
LayerCount: 2
EndChar

StartChar: uniF055
Encoding: 61525 61525 1571
Width: 945
Flags: W
LayerCount: 2
EndChar

When I change the Width property to 1024 and rebuild, the characters become properly aligned:

Aligned

Is there a good reason these characters declare a different width, or is simply an oversight? If it's an oversight I can submit a pull request to fix it.

cpkio commented 2 years ago

You didn't mention your OS and used software.

Haspaker commented 2 years ago

@cpkio macOS Catalina. It's system wide (any software), but the screenshots above are from TextEdit.

cpkio commented 2 years ago

I think this happens in software not enforcing glyph grid (like my terminal emulator in Windows, ConEmu, does, so I dont see any problems). I've done the replacements, they seem to do some width difference in non-terminal software. My PR is still waiting for review, so make your PR after @slavfox will merge.

cpkio commented 2 years ago

@Haspaker You want all the Width: 945 to be replaced by Width: 1024? I've done it in my fork already, will PR (with my other changes) if this is OK for you.

Haspaker commented 2 years ago

@cpkio I haven't done any more tests except with the two characters mentioned above, but my guess is that all widths should be set to 1024, since I have no reason to think these 2 characters are special in any way. If you want to PR that's OK with me!

slavfox commented 2 years ago

Could you verify if 1.13.0 fixes the issue?

cpkio commented 2 years ago

@Haspaker @slavfox I could have forgotten to commit this 🤦‍♂️

slavfox commented 1 year ago

image I got a chance to debug a lot of CozetteVector issues today, as of 1.19.2-hidpi CozetteVector renders properly, closing.