[XeTeX] Res: small caps not searcheable

Jonathan Kew jfkthame at googlemail.com
Tue Aug 4 18:44:28 CEST 2009


On 4 Aug 2009, at 17:35, Fr. Michael Gilmary wrote:

> Jonathan Kew wrote:
>
>
>> XeTeX and fontspec don't know anything about the PUA codes, they  
>> simply apply the OpenType feature and use the resulting glyphs.
>>
>> The reason you see the small cap glyphs as PUA codes when you try  
>> to search (or copy) in the PDF is that xdvipdfmx automatically  
>> creates a CMAP resource, to provide the mapping from glyphs to  
>> Unicode codepoints (otherwise they wouldn't be searchable/copyable  
>> at all). But to create this, it (quite reasonably) relies primarily  
>> on the cmap table of the font; and the font (quite wrongly) maps  
>> PUA codepoints to these glyphs.
>
>
> That harmonizes with results here using Garamond Premier Pro (v.  
> 2.0) --- everything looks fine and prints fine, but copy/paste or  
> searching small caps doesn't work. Thanks for the explanation,  
> Jonathan.

And thanks for the report, Fr. Michael.

It's a bit disappointing that copy/paste and search don't work; I  
thought it was supposed to attempt to construct a mapping from the  
glyph names, but perhaps that is broken. I'll try to look into it.

Oh, a thought: maybe that only works as yet with TrueType-flavored  
fonts, not CFF. But I don't remember for sure.

> What's curious (for an ignoramus like me) is that Flavio's example  
> of using simply \textit{Th} --- which is a ligature --- produces the  
> warning:
>
>> ** WARNING ** Unable to read OpenType/TrueType Unicode cmap table.
>> ** WARNING ** Failed to load ToUnicode CMap for font  
>> "GaramondPremrPro-It"
>
> But if I make it \textit{The}, there's no warning. In either case,  
> the ligature isn't searchable in any viewer here (Skim, TeXShop's,  
> Preview.app, Adobe Reader v. 8.1.2).

Very curious. Offhand, I have no idea why that happens.

JK



More information about the XeTeX mailing list