freetype
[Top][All Lists]
Advanced

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

Re: [ft] face->ascender always has the same height


From: Olumide
Subject: Re: [ft] face->ascender always has the same height
Date: Tue, 29 Nov 2016 10:49:17 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0

On 28/11/2016 22:29, Lawrence D'Oliveiro wrote:
On Mon, 28 Nov 2016 13:09:24 +0000, Olumide wrote:

#define FONT_HEIGHT 18

FT_Size_RequestRec req = { FT_SIZE_REQUEST_TYPE_BBOX , 0 ,
FONT_HEIGHT * 64 , 0 , 0 };
CHECK_STATUS( error , "Request size rec" )

FT_Request_Size( face , &req );
CHECK_STATUS( error , "Request size" )

When I try something equivalent in Python:

    import sys
    import freetype2 as ft
    from freetype2 import \
        FT

    face = ft.get_default_lib().find_face("sans-serif")
    sys.stdout.write("got face %s\n" % face.family_name)
    face.request_size \
      (
        reqtype = FT.SIZE_REQUEST_TYPE_BBOX,
        width = 0,
        height = 18,
        horiResolution = 0,
        vertResolution = 0
      )
    sys.stdout.write("face.ascender = %.3g\n" % face.ascender)

I get

    freetype2.FTException: FreeType error 151 -- invalid ppem value

I would suggest that you are getting the same error, without noticing.


Thanks for your reply and for pointing my attention to the Python bindings for FreeType.

I'd like to run your python scripts but I can't import freetype2 from python. (I can import freetype though. BTW, I installed freetype-py from here https://pypi.python.org/pypi/freetype-py/) I compiled freetype from source and I only have static library options (no dlls).

PS: are you suggesting that FreeType2 has a bug or that I'm doing something wrong.

Regards,

- Olumide





reply via email to

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