[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Return type and use of FT_Get_X11_Font_Format
From: |
David Turner |
Subject: |
Re: [ft-devel] Return type and use of FT_Get_X11_Font_Format |
Date: |
Fri, 01 Dec 2006 23:32:27 +0100 |
Hello Richard,
the problem is that FT_String is defined as "char", not "char*",
so you should really declare your variable as:
FT_String* font_face_name = FT_Get_X11_Font_Format( font_face );
Yes, I know this is so stooooopid, but we can't change this for
historical reasons. Better use char* instead of FT_String in user
code.
Regards,
- David Turner
- The FreeType Project (www.freetype.org)
On Fri, 1 Dec 2006 14:32:05 -0500, "Richard Michael" <address@hidden> said:
> Hello,
>
> I'm new to FreeType and C programming in general, but I'm trying to
> contribute to inkscape and fix a problem.
>
> I'm trying to determine the font type of a face, and using
> FT_Get_X11_Font_Format as discussed yesterday.
>
> I followed the FreeType tutorial to write a short test program, but am
> having trouble with the return type of FT_Get_X11_Font_Format (I
> think!).
>
> I've done:
>
> FT_String font_face_name = FT_Get_X11_Font_Format( font_face );
> printf("%s",font_face_name);
>
> But my program segfaults. If I print as an integer with:
>
> printf("%d",font_face_name);
>
> It prints "5".
>
> freetype/ftxf86.h indicates FT_Get_X11_Font_Format returns a "Font
> format string". Is that a special type, perhaps an index into an
> enumerated set of possible font formats? Do I need to do something
> special to process it, or is it just a string?
>
> I realize no one has the time to teach me C, I just want to know if a
> "font format string" and this function require something special.
>
> Thanks,
> Richard
>
>
> _______________________________________________
> Freetype-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/freetype-devel