Re: [ft] detecting font format from ft_face
> > Try FT_Get_X11_Font_Format(). > > Thanks, that's exactly what I need. > > I have to differentiate between truetype, type1 and type1 cid font > files. This information is supposed to be in the PDF, but it's > amazing how often it is incorrect. It also doesn't work when the > font is not embedded, and the available system font is of another > format than the PDF file says. [...] Currently, FT_Get_X11_Font_Format() is intentionally not documented well, but it seems that the information this function returns is quite important for some applications like yours. I'll make its documentation `public'. Werner ___ Freetype mailing list Freetype@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype
Re: [ft] detecting font format from ft_face
On 7/28/06, Werner LEMBERG <[EMAIL PROTECTED]> wrote: > 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. [...] > > How do I achieve the same results without using the internal header > files? Try FT_Get_X11_Font_Format(). Can you give more details on what you need exactly? Thanks, that's exactly what I need. I have to differentiate between truetype, type1 and type1 cid font files. This information is supposed to be in the PDF, but it's amazing how often it is incorrect. It also doesn't work when the font is not embedded, and the available system font is of another format than the PDF file says. By default I have to select a specific charmap. (7,x) for type1 fonts, and (1,0) or (3,1) for truetypes. Then I need to find named glyphs from the re-encoding in the PDF using a different mechanism for the two formats. CID fonts are another story altogether. To emulate CID fonts with a truetype font I need to map CIDs to whatever encoding the truetype font has. It's all rather messy, but what do you expect from an Adobe format? Tor ___ Freetype mailing list Freetype@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype
Re: [ft] detecting font format from ft_face
> 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. [...] > > How do I achieve the same results without using the internal header > files? Try FT_Get_X11_Font_Format(). Can you give more details on what you need exactly? Werner ___ Freetype mailing list Freetype@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype
[ft] detecting font format from ft_face
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 ___ Freetype mailing list Freetype@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype