[reportlab-users] Adobe Reader - Outline Font.
robin at reportlab.com
Tue Apr 3 14:04:47 EDT 2007
Ian Sparks wrote:
> If I use addOutlineEntry() is there any way to se the font that Adobe
> Reader will use to display the outline?
> I'm setting outline text using some Chinese (trad) characters and it
> looks like it's using only the Latin encoding in Adobe Reader.
> I'm experimenting with the Code2000 font. Can I set the reader to use
> that font for the outline if I embed it?
> FYI : This is Reportlab 2.0
We recently had to go through this ourselves. With latest reportlab we can use
unicode encoding in that part of the pdf output and then PDF will respect the
glyphs if the appropriate fonts are available to the reader. The fonts used are
not a property of the document (I think), but of the viewing application. That's
true for bookmarks at least. I believe the same is true for some of the
annotations eg author etc etc.
The problem is that I cannot figure out exactly how this gets done in
platypus/canvas land as the examples are all in rml eg
outlineAdd level="1">Ampersand (&) and Japanese
(ã¾ãã¯ãå¸æã®ããã«ã1ã¤é¸æãã¦ãã ãã) Test</outlineAdd>
<para>Check that the ampersand (&) appears correctly in the outline/bookmark
the above text in the example is good utf8 and when I view it I see japanese
characters in the bookmarks.
I think it works like this:
1) the outline texts eventually end up using PDFString instances.
2) The PDFString instance checks to see if the text can be rendered using PDFDoc
encoding. If yes that is used otherwise utf_16_be is output and then it's the
viewer's responsibility to make the right glyph substitutions.
More information about the reportlab-users