[poppler] how to find the true bounding box of a glyph
Bill Williamson
billhatesspam at yahoo.com
Wed Mar 7 13:42:45 PST 2012
I've noticed this as well, especially when using fonts that were subset embedded in pdfs. Particularly, the ascent value is only occasionally incorrect, depending on which subset of glyphs are included in the font. This is generally only a problem for truetype fonts. I've also noticed that the FontDescriptor in the pdf has an ascent value, which doesn't correspond at all to the internal value in the font file. I am not sure why it is even there for truetype fonts.
To throw out some ideas:
- could the browser be interpreting the font files differently than poppler. i.e. considering/not considering accents, etc...
Any ideas? I'm definitely interested in this as well.
-Bill
________________________________
From: Josh Richardson <jric at chegg.com>
To: "poppler at lists.freedesktop.org" <poppler at lists.freedesktop.org>
Sent: Wednesday, March 7, 2012 1:14 PM
Subject: [poppler] how to find the true bounding box of a glyph
Since HTML positions from the top of a span, not the baseline, it's very important for me to know the true ascent of a font. The odd font is not accurate with the reported value of this metric, and the incorrect value seems to be the value that's stored in Poppler's GfxFont. Any suggestions on how to find the true value? I think free type 2 has functions that allow me to get at the true bounding box by tracing the arcs of component splines, so I'm considering linking against that, but I'd love to know if there is a cleaner way to do it.
TIA, --josh
_______________________________________________
poppler mailing list
poppler at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler
More information about the poppler
mailing list