[reportlab-users] Re: ReportLab + Macintosh TTFs
Just van Rossum
reportlab-users@reportlab.com
Wed, 3 Jul 2002 11:24:11 +0200
Marius Gedminas wrote:
> On Wed, Jul 03, 2002 at 10:44:04AM +0200, Just van Rossum wrote:
> > Aren't you supposed to copy anything you don't know about? Maybe
> > not true when embedding TTF in PDF, I'm just guessing.
>
> That could be dangerous if those tables contain references to glyph
> numbers, which will have changed during subsetting. And I suppose
> things like digital signatures will definetely have changed. I decided
> to play it safe.
Yeah, you can safely skip the DSIG table... On the other hand: why are you
changing the glyphIDs the first place? The easiest way to do subsetting is not
to remove glyphs, but to remove their outlines (make them empty). Obviously this
will still cost some space in the loca table and other tables for unused glyphs,
but it would be safe regarding to tables you don't want tot deal with.
> OTOH it might be a good idea to copy or transform more tables -- the
> advanced typographical ones, for example.
I imagine those are very hard to transform if you change glyphIDs. I've
implemented Python converters for GPOS, GSUB and the like: they are hell...
On the other hand: they are definitely not needed by any PDF reader, since the
layout is set on the glyph level in PDF. The more I think about it, the more I
think you're current approach is fine: add those tables that are required and
skip the rest. (I'd still be wary to change the glyphIDs, though.)
> > Btw: in general, the OS/2 table is only required on Windows. Don't
> > know about when embedding in PDF.
>
> According to OpenType spec[1], it is required in all fonts.
>
> [1] http://partners.adobe.com/asn/developer/opentype/main.html
It's not required by Apple... But: if you depend on info from it I see no reason
why not to require it in the context of reportlab TTF embedding.
Just