[poppler] [patch] support Mac OS X fonts without fontconfig

Jonathan Kew jfkthame at googlemail.com
Sun Jul 12 10:51:23 PDT 2009


In order to use poppler on OS X without depending on X11 or  
fontconfig, which is not a standard component on the Mac, I have  
implemented a configure option
   --disable-fontconfig
which removes the dependency (just like when building on Windows and  
using the Windows font support).

By itself, this would mean that PDFs with non-embedded fonts cannot be  
rendered by such a Mac build; so to deal with this, I have added a new  
option
   --enable-mac-fonts
to locate platform fonts via Apple system APIs. Currently, the  
implementation is a bit ugly, because the standard fonts are not  
provided in .ttf form on the Mac, but packaged as families into .dfont  
files, which the poppler code doesn't directly support. So to handle  
these, the required face is extracted into a temporary .ttf file,  
which can then be handled by FoFiTrueType.

A neater implementation would involve finding the file path and face  
index using FT_GetFilePath_From_Mac_ATS_Name, then passing these  
through to FT_New_Face when it needs to create the Freetype face, but  
this looks like it would require more invasive changes to deal with  
the fofi code that wants to read the .ttf font file directly; that  
won't work with .dfont-packaged fonts, but would have to be modified  
to read font tables via Freetype APIs or something along those lines.

The attached patch is based on current git head.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-implement-disable-fontconfig-and-enable-mac-font.patch
Type: application/octet-stream
Size: 15875 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090712/f3b154d0/attachment-0001.obj 
-------------- next part --------------






More information about the poppler mailing list