[cairo] User fonts -> PDF questions

Adrian Johnson ajohnson at redneon.com
Fri Dec 12 13:57:55 PST 2008


Ian Britten wrote:
> 1) When selecting the text, the highlight box isn't correct:
>      - In AdobeReader_enu-8.1.2_SU1-1), the blue highlight box is
>        shifted to the right by half the width of the glyph.  The
>        vertical positioning seems ok.
>      - In evince-2.22.2-1.1mdv2008.1, not only is the highlight
>        box shifted to the right by half the width of the glyph, but
>        the box is also more than twice the height of the text.
>      - NB - When selecting TT fonts, both of these tools seem to
>        have a highlight box that is about twice the height of the
>        glyphs, but centred vertically.

Selecting the text in the PDF output from the user font tests
in the cairo test suite works correctly for me. Try the user font tests 
and see if that works for you. If it does, creating a minimal test case 
from your code and providing the PDF output would assist in debugging 
the problem.

> 2) When I copy+paste the text from the PDF, I don't get my text.
>      - From AdobeReader, I get one 􀀀 character for each character.
>      - From evince, I get one 0 character for each character.

The user font tests work fine for me with the exception of the first 
glyph. I need to look into that but the rest of the characters are 
extracted correctly. Have a look at the the user font tests to see if 
you are missing anything in your implementation.

> 3) When I look at the embedded fonts (under File->Properties in
>      evince), all my embedded fonts are called "No name".
>      Is there a way I can set some sort of informative name
>      reflecting my user font?  Or should it maybe have already done
>      that, and I've not got something set up correctly? (Either in
>      my Cairo UserFont or in my custom FT_Driver/FT_Face?)

PDF does not provide good support for naming Type 3 fonts. There is a 
/Name key in the Type 3 dictionary but its description refers to the 
Type 1 /Name key which is described as "obsolete and should not be used" 
[1]. acroread appears to use this name in the font properties dialog but 
evince does not. Cairo does not provide any means to specify a name for 
a user font.

> 4) I've been asked by some people about being able to control some
>      of the additional PDF attributes (eg: security->printing,
>      layers, etc).
>      I confess I don't know much about this stuff, but am just
>      wondering if there is any (cairo) interface to this stuff
>      (Either currently or planned)?

There is no support in cairo for these features. You can use pdftk to 
apply these features to a PDF.

> 5) When I draw my text in evince, the colour of the first glyph
>      is wrong (black).  It looks correct in AdobeReader, kpdf,
>      and gv.  (Maybe this is just an evince problem though...)

It was a poppler bug that has been fixed in the latest version.

[1] http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf



More information about the cairo mailing list