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

Height/depth metrics are incorrect #2891

Open
edemaine opened this issue Apr 8, 2018 · 2 comments
Open

Height/depth metrics are incorrect #2891

edemaine opened this issue Apr 8, 2018 · 2 comments
Labels

Comments

@edemaine
Copy link
Member

edemaine commented Apr 8, 2018

@ylemkimon wrote:

During refactoring the generation scripts of fonts and their metrics, I discovered that yMax and yMin from generated TTF does not match height and depth from tfm(TeX font metrics).

Are their definitions different? Or, do they change during conversion process? If so, which metrics should KaTeX use?

I just did some spot checking of Typewriter-Regular (as that's what I was working on recently) and the letters I checked seemed close, but there's definitely some error. For example, y has a yMin of -228 and yMax of 431 in the generated TTF, while the metrics file says [0.22222, 0.43056, ...]. That's more than floating-point rounding should account for...

@kevinbarabash
Copy link
Member

I don't think this is actually an issue. There are a couple of things which affect the metrics:

  • makeBlacker makes the fonts heavier than they would otherwise be
  • one of the scripts that generates the fonts actual generates bitmaps and then traces those bitmaps to generate curves... there's probably some imprecision in that process

@ylemkimon
Copy link
Member

ylemkimon commented Apr 13, 2018

So if we use metrics from tfm, and for those not in tfm, use metrics from ttf, wouldn't it lead to discrepancies or inconsistencies?

@ylemkimon ylemkimon transferred this issue from KaTeX/katex-fonts Apr 5, 2021
@ylemkimon ylemkimon added the fonts label Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants