[poppler] Fontconfig dependency for pdftops?

Albert Astals Cid aacid at kde.org
Tue Feb 19 13:32:39 PST 2008


A Dimarts 19 Febrer 2008, Peter Åstrand va escriure:
> On Sun, 10 Feb 2008, Peter Åstrand wrote:
> > We are updating our "pdftops" from the one shipped with xpdf-2.02pl1 to
> > the latest poppler version. Is fontconfig a hard dependency nowadays,
> > even for tools like pdftops?
>
> I think I can answer this myself. Yes, it's a hard dependency, but it's
> easy to get rid of. pdftops seems to work perfectly fine without
> fontconfig, and the size of the resulting binary is greatly reduced.
> Another great advantage is that the binary will be self contained and does
> not require a fontconfig configuration.
>
> In GlobalParams.cc, there's a comment:
>
>  /* if you can't or don't want to use Fontconfig, you need to implement
>     this function for your platform. For Windows, it's in
> GlobalParamsWin.cc */
>
> However, the code in question is surrounded by "#ifndef _MSC_VER", which
> is not very generic. The attached patch generalizes this and depends on
> the define "DISABLE_FONTCONFIG" instead. Additionally, it provides a stub
> implementation of getDisplayFont on UNIX, when fontconfig is not used.
>
> Any chance this patch can be accepted? In addition to making it possible
> to build Poppler without fontconfig on UNIX, it also makes it possible to
> build Poppler for Windows with MinGW, without Fontconfig.

First a easy question:
 * Do you really need that config.h includes in HtmlFonts.cc and 
PreScanOutputDev.cc?

And now onto the core part of the mail. You are "wrong", pdftops uses 
PSOutputDev which does getDisplayFont calls in some situations, so right, 
it's not a HARD dependency, but you most probably want it or those situations 
won't work.

So i'm actually not much keen of adding that patch, but if others OK it, i 
think i could tolerate it if we add a big warning saying that "FontConfig 
will not be used and PDF without embedded fonts will not work"

So i want input from others here, Jeff? Carlos? Brad? Pino?

Albert

>
> Best regards,
> ---
> Peter Åstrand		ThinLinc Chief Developer
> Cendio AB		http://www.cendio.se
> Wallenbergs gata 4
> 583 30 Linköping	Phone: +46-13-21 46 00




More information about the poppler mailing list