[poppler] Kpdf patches status
jeff at infidigm.net
Sun May 1 18:04:58 PDT 2005
On Mon, May 02, 2005 at 12:25:34AM +0200, Albert Astals Cid wrote:
> A Dilluns 02 Maig 2005 00:12, v?reu escriure:
> > One of the things I still don't understand is why type1 fonts are still
> > done with temp files. Also are there any numbers that show that this
> > patch makes any difference?
> I can try to make it in smaller parts but it's not that easy.
> Well files are not beign written to file and read from there, instead of that
> they are beign passed in memory, i think that has to have some speed reward
I am sure it is faster, I just wonder if it makes a noticable
difference. I do agree that loading the fonts from memory does seem more
elagant. Although I do also wonder how it impacts memory usage.
> > The "one line CJK patch". This patch is probably ok to apply but isn't
> > it more just a work around for a freetype bug?
> Hmmm, i'd say no, i don't think it's fine to do a cast to FT_OutlineGlyph when
> using only FT_LOAD_DEFAULT because that can return a bitmap that is obviously
> not an outline, no?
Yep I am convinced and commited the patch.
> > The fontconfig patch is also probably ok to commit but we should really
> > be doing font matching using font descriptors (I don't know whether they
> > are manditory...)
> Font descriptors? I think i'm lost here
So here is my take on the font matching situation.
Currently I believe poppler uses the /BaseFont entry in the font
dictionary object to do all the font matching. The pdf spec describes
this for Type 1 fonts as the PostScript name of the font. For TrueType
fonts it is: The PostScript name for the value of BaseFont is determined
in one of two ways:
Â· Use the PostScript name that is an optional entry in the "name" tabl
of the TrueType font.
Â· In the absence of such an entry in the "name" table, derive PostScript
name from the name by which the font is known in the host operating
system. On a Windows system, the name is based on the lfFaceName field
in a LOGFONT structure; in the Mac OS, it is based on the name of the
FOND resource. If the name contains any spaces, the spaces are
In addtion TrueType fonts can have either Bold, Italic or BoldItalic
appended to the font name after a comma to describe styles that must be
Neither of descriptions of /BaseFont particularily good things to be
passing to fontconfig as FC_FAMILY and afaik fontconfig does not have a
way to match against the postscript name of a font.
Each font also needs to have a FontDescriptor table which contains
a whole bunch of information that should be passed to fontconfig for
Ideally poppler should just use the information in the FontDescriptor
table to pick a font ignoring the /BaseFont entry completely.
Unfortunately, these tables do not always contain as much information as
we would like. So it looks like we may often need to use some heuristics
to pick information out of the /BaseFont entry. These heuristics should
be different depending on whether or not the font is TrueType or Type1.
More information about the poppler