freetype
[Top][All Lists]
Advanced

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

Re: [ft] freetype demos


From: armin
Subject: Re: [ft] freetype demos
Date: Sat, 13 Apr 2019 01:51:36 +0100

> First, thanks for all the help this week...

No worries, you're welcome :)

> Does anyone know an easy method for converting a freetype demo to use
> FT_Set_Pixel_Sizes() instead of FT_Set_Char_Size()?

If you're simply talking about the conversion (formula) of the values,
https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html could be what
you were looking for; for example, using something like

```
FT_Set_Char_Size( face,
                  (FT_UInt)round( char_width  / 64.0f * horz_resolution /
72.0f,
                  (FT_UInt)round( char_height / 64.0f * vert_resolution /
72.0f );
'''

(Untested;  please correct me if brackets are missing or I'm mixing up 64s
and 72s here ... errors should be fairly easy to spot).

Note that you lose precision in the process.

Best
Armin





reply via email to

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