[reportlab-users] [PATCH] Add TTF Embedding Option

Yoann Roman yroman-reportlab at altalang.com
Fri Oct 17 09:26:16 EDT 2008


Robin Becker wrote...

> I'm guessing that one or other of the standard encodings is being used

> for the first subset. It might be cp1252 or perhaps one of the other

> adobe standards eg winansi.


It sets it to winansi. What's odd is that, according to the 1.3 spec,
cp1252 code point 181 is in the winansi encoding, but using that
character switches to embedded subsets (one winansi, the other
"Identity-H").


> asciiReadable just prepopulates the first subset with something which

> matches the ordinary ascii values. That means when you look at the pdf

> code in an editor many characters will be readable in the first

> subset.


This sounds like something that would make debugging easier but isn't
necessary otherwise. If that's the case, out of curiosity, why is it
enabled by default?


> If a ttf font is on the never-embed list then presumably we can make

> the assumption that there's some initial subset (which we need to

> firm up) and then succeeding subsets are generated in the standard

> way. At object embedding time we just don't bother with the first

> subset. That would make the splitString mechanism work as before.


The issue I had with that approach was that, if Arial isn't embedded,
Acrobat seems to want cp1252 code points instead of the UTF-8 code
points that splitString returns.


> What happens when these files are delivered to a platform that doesn't

> have the font? I notice that you appear to have attached some files to

> one of your emails, but I didn't see them come through.


Not sure. Acrobat may have some built-in mapping for these or it could
just rely on standard font substitution. The PDF examples I attached
had Arial embedded and were all above the 40k max for the list, so my
message bounced.

I've attached Acrobat's "Standard" output, which does not embed Arial;
I again knocked it down to 1.3, which increased the file size slightly
from the default 1.6.

Thanks,

--
Yoann Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Acrobat-Arial-Standard.pdf
Type: application/pdf
Size: 7497 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20081017/69c74e17/attachment-0001.pdf>


More information about the reportlab-users mailing list