[XeTeX] Use of Apple Symbols font in XeLaTeX

Bruno Voisin bvoisin at mac.com
Fri Sep 17 14:27:21 CEST 2004


Le 17 sept. 04, ˆ 12:55, Jonathan Kew a Žcrit :

> Does Omega include an extended \mathchar, by any chance? That might  
> provide a model for what should be done, but at present I don't think  
> you can encode character codes > 255 in a \mathchar.

I think that Omega does this, though I cannot say more, not being an  
Omega user myself. From  
/usr/local/teTeX/share/texmf.tetex/doc/omega/base/doc-1.12.ps, p. 6:

½, on the other hand, allows 256 (2^8) font families, each font of 65  
536 (2^16) characters. So, in addition to the TEX math font primitives,  
which continue to work, there are 16-bit versions:
[...]
¥ \omathchar  27-bit number  : Generates a math character with 27-bit  
math code;
[...]
where
[...]
¥  27-bit number  refers to value 0x8000000 or a triple
	Ð 3 bits for math category,
	Ð 8 bits for font family,
	Ð 16 bits for character in font,
called a math code;

> The standard TeX math fonts, of course, don't use character codes >  
> 255, and so this wasn't a problem for supporting legacy math  
> formatting; but it's a problem as we look to a properly  
> Unicode-encoded future.

For my specific problem, here's finally the dirty fix I've used, based  
on amsmath.sty's \text command allowing straightforward input of text  
in maths:

	\usepackage{amsmath}

	\DeclareFontFamily{U}{appsym}{}
	\DeclareFontShape{U}{appsym}{m}{n}{<-> "Apple\space Symbols"}{}

	\DeclareTextFontCommand{\applesym}
	  {\normalfont\fontencoding{U}\fontfamily{appsym}\selectfont}

	\DeclareRobustCommand{\textapplehighplus}    {\applesym{\char"253C}}
	\DeclareRobustCommand{\textappleblacksquare} {\applesym{\char"25A0}}
	\DeclareRobustCommand{\textapplewhitesquare} {\applesym{\char"25A1}}
	\DeclareRobustCommand{\textappleblackdiamond}{\applesym{\char"25C6}}
	\DeclareRobustCommand{\textapplewhitediamond}{\applesym{\char"25C7}}
	\DeclareRobustCommand{\textapplewhitecircle} {\applesym{\char"25CB}}
	\DeclareRobustCommand{\textappleblackcircle} {\applesym{\char"25CF}}

	\DeclareRobustCommand{\applehighplus}    {\text{\textapplehighplus}}
	\DeclareRobustCommand{\appleblacksquare} {\text{\textappleblacksquare}}
	\DeclareRobustCommand{\applewhitesquare} {\text{\textapplewhitesquare}}
	 
\DeclareRobustCommand{\appleblackdiamond}{\text{\textappleblackdiamond}}
	 
\DeclareRobustCommand{\applewhitediamond}{\text{\textapplewhitediamond}}
	\DeclareRobustCommand{\applewhitecircle} {\text{\textapplewhitecircle}}
	\DeclareRobustCommand{\appleblackcircle} {\text{\textappleblackcircle}}

This provides better compatibility with existing plain  
TeX/LaTeX/amssymb.sty math symbols, allowing the replacement of these  
symbols by Apple's ones:

	% For plain TeX and standard LaTeX
	\def\bigcirc{\applewhitecircle}
	% For latexsym.sty
	\def\Box{\applewhitesquare}
	\def\Diamond{\applewhitediamond}
	% For amssymb.sty
	\def\square{\applewhitesquare}
	\def\blacksquare{\appleblacksquare}
	\def\lozenge{\applewhitediamond}
	\def\blacklozenge{\appleblackdiamond}

Thanks for your clarification,

Bruno



More information about the XeTeX mailing list