[cairo] PS surface and composite glyphs

Kristian Høgsberg krh at bitplanet.net
Wed Aug 10 10:43:17 PDT 2005


Adrian Johnson wrote:
> Robert O'Callahan wrote:
> 
>> On Fri, 2005-08-05 at 02:08 -0400, Kristian Høgsberg wrote:
>>
>>> Adrian Johnson wrote:
>>>
>>>> Is Type 1 font support planned for the postscript backend?
>>>
>>>
>>> Yes, but not subsetting.  That shouldn't be a problem, though, since 
>>> Type1 fonts are restricted to 255 glyphs.  My plan was to just embed 
>>> the Type1 font directly, but I haven't yet figured out how to get at 
>>> the raw font data given an FT_Face using the public freetype API.
>>
>> You may find this code and its references instructive:
>> http://lxr.mozilla.org/mozilla/source/gfx/src/ps/nsType1.cpp
>> It may even be possible to reuse some of that code ... it's GPL/LGPL/MPL
>> tri-licensed.
> 
> I don't think this code would be the best solution as all the
> hint commands from the CharStrings dictionary will be lost.
> It would be better if freetype made the raw font data available.
> 
> The code would be useful for printing truetype fonts to printers
> that don't support Type 42. It could also be used for printing
> any other scalable font type supported by freetype.

Yep, doing it the mozilla way throws away the hinting information, but 
the link was useful though.  What I wanted to do was to embed the entire 
font in the output, and Owen pointed me to

   http://cvs.gnome.org/viewcvs/pango/pango/opentype/ftglue.c

as an example of code that accesses the face->stream field of an 
FT_Face.  That field is marked as private but seems to have become part 
of the public API.

What I ended up doing though, was writing subsetting code after all.  I 
have patch that I just need to clean up a bit, then I'll send it to the 
list.

Kristian



More information about the cairo mailing list