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

OTB files generated by old version of fonttosfnt have incorrect metrics #30

Open
ghost opened this issue Oct 18, 2020 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Oct 18, 2020

This was previously discussed in #25

I didn't end up using the newly generated .otb due to reasons outlined in this post: #25 (comment) (i.e. alacritty could succesfully use the .otb, but pango couldn't). I gave up and downgraded Pango instead.

Today I decided to try again, as it looks like updates have been made to Pango.

With Pango 1.46.2, there is still an extra 1-pixel gap between glyphs when using the .otb version.

I did a lot of digging and debugging, and I was able to eventually figure out that the version of fonttosfnt used at the time of #25 had some issues w.r.t. calculating font metrics. This means that Pango was never the issue.

The method outlined in #25 (comment) can be used, but needs the latest version of fonttosfnt to convert properly. (everything from the last release (1.1.0) up to commit ca9ad454, https://gitlab.freedesktop.org/xorg/app/fonttosfnt)

This will probably be easier once they push out a new release, but I just wanted to confirm that:

  1. The issue still exists
  2. There is a solution
  3. I've tested the result this time, and can verify that Tamzen works with newer versions of Pango
@ghost
Copy link
Author

ghost commented Oct 18, 2020

For interest's sake, I couldn't figure out exactly what changed in fonttosfnt, but I imagine that the issue must be related to things like this: https://gitlab.freedesktop.org/xorg/app/fonttosfnt/-/commit/de8068f9c4251fb6cb9407c07bf245e1937270bc

If you have more time, you can use Python FontTools to dump .otb metadata, e.g.

fonttools ttx -t EBLC TamzenForPowerline7x13r.otb

That gives you a .ttx file which is a human-readable version of the binary headers in the font file. I thought the issue was that horiBearingX was set to 1 (whereas for OTB versions of Terminus it's 0), but it seems like the change that makes the font render properly must be in another table.

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

1 participant