[poppler] Fontconfig patch

Stefan Kleine Stegemann stefankst at gmail.com
Sun Jul 17 03:29:16 EST 2005


Hi,

I finaly got PopplerKit working fine with fontconfig. This also improved
font handling in PopplerKit. The solution is to setup a custom FcConfig
object and set this as fontconfig's default configuration before poppler
accesses fontconfig. I now have one problem left with these two lines from
the patch:

FcInit();
FCcfg = FcInitLoadConfigAndFonts();

As far as I understand the fontconfig sources, FcInit creates a
new default configuration if it does not exist. The default
configuration can be set using the FcConfigSetCurrent function.
If a default configuration has already been set before FcInit,
FcInit simply returns without doing anything. FcInitAndLoadConfig
loads the system default configuration file and creates a FcConfig
with this file. FcInitAndLoadConfig is implicitly invoked by FcInit
if no default configuration has been set. So you acutally do the work
twice. It would be sufficient to call FcInit first and the use
FcConfigGetCurrent to get the default FcConfig. This way, I can set
up a custom FcConfig and set this as default (using FcConfigSetCurrent)
BEFORE PopplerKit initializes the poppler libary.

BTW: FcInitAndLoadConfig dumps core on OSX if it cannot load the
system wide fontconfig config file. So I have to avoid that it's
getting called.

Another option would be to provide a method to set the FcCfg from
outside.

Can you modify your patch accordingly?

greets & thanks
Stefan

-- 
Stefan Kleine Stegemann
Mail: stefankst at gmail.com
Home: http://rzserv2.fhnon.de/~lg017420


More information about the poppler mailing list