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

Need explanation for Glyph output txt #8

Open
UnKabaraQuiDev opened this issue Jan 17, 2024 · 1 comment
Open

Need explanation for Glyph output txt #8

UnKabaraQuiDev opened this issue Jan 17, 2024 · 1 comment

Comments

@UnKabaraQuiDev
Copy link

I assume the image coordinates are from (0, 0) (top left) -> (1, 1) (bottom right)

My questions:

  1. What is the difference between:
  • Width and Texture Width
  • Height and Texture Height
  • Horizontal Bearing X and Vertical Bearing X
  • Horizontal Bearing Y and Vertical Bearing Y
  1. What even are:
  • Horizontal/Vertical Bearing X/Y
  • Horizontal/Vertical Advance

From what I've understood, Texture Width/Height is the size of the glyph on the texture, in a (0,0) -> (1,1) coordinate space, and Texture Coord X/Y is the position of the glyph on this same texture.

But what's the deal with the other width/height, and the difference between Horizontal/Vertical advance and the Texture Coords ?

@ShoYamanishi
Copy link
Owner

Hi Poucy113,

I have updated the README that should contain enough material to get you started.
Any suggestions or pull requests for improvements are welcome.

As for the font metrics in general, you can take a look at the following.
https://freetype.org/freetype2/docs/glyphs/glyphs-3.html

An extra complication for the signed distance fonts is that you have to expand the glyph bounding boxes to accommodate the spread. Hopefully it is clear in the latest README.

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

No branches or pull requests

2 participants