[reportlab-users] Re: ReportLab + Macintosh TTFs

Marius Gedminas reportlab-users@reportlab.com
Wed, 3 Jul 2002 11:50:00 +0200


On Wed, Jul 03, 2002 at 11:24:11AM +0200, Just van Rossum wrote:
> 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.

It just never occurred to me.  Before starting this work I looked at
several TTF embedding implementations (PDFs produced by Distiller,
FinePrint, pdflib, Big Faceless PDF Library, etc.), and I think most of
them (OK, at least *one* of them) did this glyph renumbering thing.

> > > 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.

I only need OS/2 table for ascender/descender values, and to check if
the font file allows subsetting/embedding.

Marius Gedminas
-- 
We don't really understand it, so we'll give it to the programmers.