Skip to content

Can't work out "top-side" bearing or "horiBearingY" in TrueType #1275

Answered by nothings
SimonMaracine asked this question in Q&A
Discussion options

You must be logged in to vote

I searched all over the internet

I think the docs in the file are pretty clear?

STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1);
// get the bbox of the bitmap centered around the glyph origin; so the
// bitmap width is ix1-ix0, height is iy1-iy0, and location to place
// the bitmap top left is (leftSideBearing*scale,iy0).
// (Note that the bitmap uses y-increases-down, but the shape uses
// y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SimonMaracine
Comment options

Answer selected by SimonMaracine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants