Re: Finding out the appropriate texture size for a font
Alexei Podtelezhnikov <[email protected]> Mon, 29 Jul 2024 09:48:59 -0400
| Newsgroups | gmane.comp.fonts.freetype.user |
|---|---|
| Message-ID | <CAJU=AjXoiEXmUdQC+yLZ0U_=_T9YxxGdwTrFWXK1yUaCbyOdww@mail.gmail.com> |
> > have to convert to pixels > > Can you explain how to do that? Since the bounding box is fixed, I > presume it will somehow involve the pixel size I'm passing to to > FT_Set_Pixel_Sizes. I've gone through the documentation and am > still a little confused. I suggest using x_scale and y_scale from size->metrics. See https://freetype.org/freetype2/docs/reference/ft2-sizing_and_scaling.html#ft_size_metrics Something like xMax = FT_MulFix(face->bbox.xMax,face->size->metrics.x_scale); will be given in fractional 26.6 pixels. Alexei