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:59:04 +0100

> ```
> 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).

Phew, quite a lot of issues at once ... let me try again ...

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

... where `char_*' and `*__resolution' are inputs to
`FT_Set_Char_Size(...)'.

> Note that you lose precision in the process. 





reply via email to

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