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

Robin Becker robin at reportlab.com
Thu Oct 16 07:24:59 EDT 2008

Yoann Roman wrote:

> Per the earlier discussion (see "Disable TTF Embedding"), I was looking

> for a way to replicate Acrobat's "never embed" font option in RL.


> The only patch needed for TrueType fonts was to ttfonts.py. The default

> behavior does not change; this adds an optional "embed" argument to

> TTFont that, if explicitly set to 0, will prevent the font embedding.


> I wasn't sure if the encoding was necessary. Acrobat specifies it, the

> spec says its optional, and RL leaves it out for TTFs. I followed RL

> and left it out.


> I'm certainly no PDF spec expert and don't know if this has unintended

> side effects. I also realize most people won't need this, but, since it

> doesn't change the default behavior and is a minimal patch, I don't see

> any harm in adding it.


> Thanks,


I'm really unclear why this should be used by any rational person, but if it
works for you I see no reason not to use it.

I am puzzled by the patch though.

Should we not be turning off all of the subsetting code?

It just happens that we currently preset the first subset to be the standard
ascii subset (in the default case) so perhaps this won't work if two or more
subsets are required.

I'll try later with some tests high order arial characters.
Robin Becker

More information about the reportlab-users mailing list