freetype
[Top][All Lists]
Advanced

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

[ft] detecting font format from ft_face


From: Tor Andersson
Subject: [ft] detecting font format from ft_face
Date: Fri, 28 Jul 2006 13:46:55 +0200

Hi!

I am updating my MuPDF PDF viewer to use freetype 2.2 and I have hit a snag.
Because of the way PDF treats encodings, I need to know the format of a
loaded font face.

Previously I have used the following hack to switch on the driver used:

enum { UNKNOWN, TYPE1, CFF, TRUETYPE, CID };

static int ftkind(FT_Face face)
{
        const char *kind = face->driver->clazz->root.module_name;
        if (!strcmp(kind, "type1"))
                return TYPE1;
        if (!strcmp(kind, "cff"))
                return CFF;
        if (!strcmp(kind, "truetype"))
                return TRUETYPE;
        if (!strcmp(kind, "t1cid"))
                return CID;
        return UNKNOWN;
}

How do I achieve the same results without using the internal header files?

Tor




reply via email to

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