[XeTeX] asterism

Joel C. Salomon joelcsalomon at gmail.com
Sun Jan 17 01:56:19 CET 2010


On 1/12/2010 5:00 AM, Jonathan Kew wrote:
> On 12 Jan 2010, at 09:28, Michiel Kamermans wrote:
>> teginch at bluewin.ch wrote:
>>> Thanks for your input. I had something along the lines of Peter Flynn's solution in my mind which would allow to use the same font. Worked great for me.
>>
>> Note that this is of course very much not an asterism, but a creative way to construct something that looks like an asterism. As a consequence, people will not be able to do a search for an asterism in your document, even though reasonably speaking PDF files should be searchable. An alternative to the creative "making your own asterism rather than using the real unicode codepoint glyph" is to use XeLaTeX's character classes and define a new class for the asterism, and then setting up some simple rules to swap fonts only for characters from this class:
> 
> For a one-off symbol like this, I wouldn't go to the trouble of setting up a character class (note that if you have lots of classes, and if you can't guarantee they'll always have spaces or other non-character stuff adjacent to them, then you need to consider the transitions between *all* possible pairs, which can get pretty unwieldy).
> 
> Simpler to make the character \active, and just define it as a macro:
> 
>   \catcode"2042=\active
>   \def^^^^2042{{\asterfont\char"2042}}
> 
> where \asterfont is defined suitably using \newfontfamily.

Seems to me that the custom asterism construction could also work, if
there’s some way to tell the PDF reader, “here’s a couple of arbitrary
glyphs, but treat them as a single U+2042 character for search &
copy-paste purposes.”

—Joel C. Salomon


More information about the XeTeX mailing list