[cairo] Improving PDF output

Baz brian.ewins at gmail.com
Tue Jan 9 01:48:00 PST 2007


On 08/01/07, Carl Worth <cworth at cworth.org> wrote:
> The only really hard part[*] about declaring 1.2 as a stable release
> with "supported" PDF output was the fact that text was not cut-and-
> pasteable. That was an embarrassing deficiency that we've all wanted
> to make disappear but nobody has had time to give the issue any
> attention yet.

So last night the question came up on IRC of what Apple does to make
text selectable in pdfs. I tried dumping pdf output from ATSUI into a
CGPDFContext, with surprising results.

Firstly, I couldn't get the ATSUI PDF to show ligatures at all (for
the Zapfino font, despite other font features working ok), but the
text was always selectable. I tried a little arabic too and was
surprised to find that the /required/ ligatures didn't get used.

So, next I switched to TextEdit and created the same text with
ligatures on and off, then saved it as PDF. Copy-and-paste of the text
only worked with ligatures off ("The fifty spiffy apples." twice came
out as "The fifty spiffy a The fifty spiffy apples.". The pp ligature
seemed to be the point of failure)

So - it appears to me that Apple are doing glyph->unicode mapping
exactly like Alp does when the glyph and unicode count is the same,
and ATSUI seems to try to push you to ligatureless output so copy &
paste works; though maybe I messed up there somehow.

Cheers,
Brian


More information about the cairo mailing list