[poppler] Fontconfig patch

Martin Kretzschmar m_kretzschmar at gmx.net
Thu Jul 21 07:37:18 EST 2005


Am Mittwoch, den 20.07.2005, 18:36 +0200 schrieb Albert Astals Cid:
> > >>-     but that matches windows ttf which gets wrong encoding */
> > >>-  {"Symbol",                "Standard Symbols L,Symbol"},
> >
> > We should test if we need a special workaround for the "Symbol" font in
> > the new fontconfig code too. As written in the comment, I had just
> > stolen the patterns from mupdf. I never tested the old code with the
> > Symbol font.
> 
> Well on my system 
> 
> $ fc-match Symbol
> s050000l.pfb: "Standard Symbols L" "Regular"

That was not the problem I thought of. But now that you mention it, this
doesn't match anything here on Ubuntu :-( Neither does Zapf Dingbats
match anything with the default configuration.

The original problem: someone might have copied all his windows ttfs,
one of which is symbol.ttf. The comment from mupdf said that it might
cause problems.

> > >>+FcPattern *buildFcPattern(GfxFont *font)
> > >>+{
> > >>+  int weight = FC_WEIGHT_NORMAL,
> > >>+      slant = FC_SLANT_ROMAN,
> > >>+      width = FC_WIDTH_NORMAL,
> > >>+      spacing = FC_PROPORTIONAL;
> > >>+  bool deleteFamily = false;
> > >>+  char *family, *name, *lang, *aux = NULL;
> > >>+  const char *h = NULL;
> > >>+  FcPattern *p;
> > >>
> > >>-  lockGlobalParams;
> > >>-  dfp = (DisplayFontParam *)displayFonts->lookup(fontName);
> > >>-  unlockGlobalParams;
> > >>-  return dfp;
> > >>+  // this is all heuristics will be overwritten if font had proper info
> > >>+  name = font->getName()->getCString();
> >
> > Can getName() return NULL?
> I would say no, the only fonts that don't have name are Type 3 fonts but they 
> never reach that part of the code. But i can write a guard if you think it's 
> necessary.

Someone might construct a bogus pdf file without a name to crash pdf
viewers ;-)

Regards,

Martin





More information about the poppler mailing list