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: Sagar Tiwari
Subject: Re: Finding out the appropriate texture size for a font
Date: Mon, 29 Jul 2024 20:44:04 +0530

 I got it working. Thanks Werner and Alexei.

On Mon, Jul 29, 2024 at 7:19 PM Alexei Podtelezhnikov <apodtele@gmail.com>
wrote:

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


-- 
Best Regards
Sagar Tiwari


reply via email to

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