TrueType font

Igor Korot ikorot at
Mon Jan 15 22:56:22 PST 2007

Thank you for the reply.
I'm looking for a way to check if the font that I will create will be a TrueType font.

Basically, if you look at any Windows implementation of font selection dialog, you will see
a little icon in front of the TrueType font name.
I am looking for a way to do something like this under X.

Thank you.

-----Original Message-----
>From: Juliusz Chroboczek <Juliusz.Chroboczek at>
>Sent: Jan 15, 2007 1:50 PM
>To: Igor Korot <ikorot at>
>Cc: xorg at
>Subject: Re: TrueType font
>> How can I check from my C++ program that a font is a TrueType font?
>What do you mean by ``font''?  A font file, an X11 core font instance,
>a FontConfig FcPattern or an XftFont, or something else?
>TrueType font files have a signature in the first four bytes.  These
>bytes should be
>  00 01 00 00 for a TrueType font;
>  4F 54 54 4F for an OpenType/CFF font.
>(OpenType/TTF is just another name for TrueType.)
>If it's a core font instance you want to know about (a thingie
>returned by XLoadFont), check for the value of the property FONT_TYPE.
>If it's an FcPattern you want to look at, check the value of the
>property ``fontformat''.
>If it's an XftFont, a g_font, a Qt font, or something else, I've got no idea.
>                                        Juliusz

More information about the xorg mailing list