freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding out the appropriate texture size for a font


From: Alexei Podtelezhnikov
Subject: Re: Finding out the appropriate texture size for a font
Date: Mon, 29 Jul 2024 09:48:59 -0400

> > 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]