SDL_ttf icon indicating copy to clipboard operation
SDL_ttf copied to clipboard

Add TTF_GetFontBBox() which returns font's extremum bounding box

Open ivan-mogilko opened this issue 7 months ago • 1 comments

Resolve #536

This adds a new function called TTF_GetFontBBox:

extern DECLSPEC void SDLCALL TTF_GetFontBBox(const TTF_Font *font, TTF_BBox *bbox);

and a struct TTF_BBox (simply a pair of xmin/max and ymin/max offsets).

This function may be used to query font's bbox, which is a bounding box enough to suit any glyph from this font. Function description is based on FreeType comments to FT_Face's bbox field.

I was not certain which version to mention in comments, so put 2.26.0, as that seems to be the next release number, theoretically?

ivan-mogilko avatar Mar 28 '25 14:03 ivan-mogilko