<div dir="ltr"><div>Not sure if xetex can do colour fonts currently, You can always experiment with luatex which gets this if using harfbuzz</div><div><br></div><div><img src="cid:ii_kmfbe8630" alt="image.png" width="244" height="136"><br></div><div><br></div><div>\documentclass{article}<br><br>\usepackage{fontspec}<br><br>\newfontfamily\chess[Renderer=HarfBuzz]{BabelStoneXiangqiColour.ttf}<br>\begin{document}<br><br>testing {\chess ^^^^^^01fa64}<br><br>\end{document}<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 18 Mar 2021 at 18:39, Philip Taylor <<a href="mailto:P.Taylor@rhul.ac.uk">P.Taylor@rhul.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
Seeking to re-typeset a long out-of-print classic on Xiang-Qi ("Chinese Chess"), but with the pieces shewn as they really are rather than as upper-case Latin letters requiring a gloss (the presentation chosen by the original author), I downloaded and installed
Andrew West's <a href="https://www.babelstone.co.uk/Fonts/Xiangqi.html" target="_blank">
BabelStone Xiangqi Colour font</a>. I then wrote a short piece of XeTeX code to check that the glyphs/pieces appear in the PDF as they should, and very sadly they do not, coming out as monochrome rather than in colour (see attached PDF).
<br>
<br>
The red pieces are described by Andrew as <i>red Chinese characters on a sandy yellow background</i>, and the black pieces as
<i>black Chinese characters on a sandy yellow background.</i> In the resulting PDF, however, they appear as white Hanzi on a black ground and black Hanzi on a white ground. Does XeTeX support coloured fonts, and if so, how do I persuade it to render these
glyphs as intended rather than in monochrome ? <br>
<br>
I can, of course, load <tt>\font \redpieces = "BabelStone Xiangqi Colour":color=FF0000 scaled \magstep 5
</tt>(see code below), but that still does not give me the sandy yellow ground that each glyph was designed to have.<br>
<br>
<tt>'opentype-info.tex'</tt>, when run against BabelStone Xiangqi Colour, tells me that the font does not provide any Opentype layout features, so it does not look as if XeTeX's "/ICU:+abcd" convention would allow me to indicate that I require colour support.<br>
<br>
<blockquote type="cite"><tt>% !TeX Program=XeTeX<br>
<br>
\font \pieces = "BabelStone Xiangqi Colour" scaled \magstep 5</tt><tt><br>
</tt><tt>\font \redpieces = "BabelStone Xiangqi Colour":color=FF0000 scaled \magstep 5</tt><tt><br>
</tt><tt>\font \blackpieces = "BabelStone Xiangqi Colour" scaled \magstep 5</tt><tt><br>
</tt><tt>\pieces</tt><tt><br>
</tt><tt>\centerline {\char "1FA60\relax \ \char "1FA61\relax \ \char "1FA62\relax \ \char "1FA63\relax \ \char "1FA64\relax \ \char "1FA65\relax \ \char "1FA66\relax}</tt><tt><br>
</tt><tt>\centerline {\strut}</tt><tt><br>
</tt><tt>\centerline {\char "1FA67\relax \ \char "1FA68\relax \ \char "1FA69\relax \ \char "1FA6A\relax \ \char "1FA6B\relax \ \char "1FA6C\relax \ \char "1FA6D\relax}</tt><tt><br>
</tt><tt>\centerline {\strut}</tt><tt><br>
</tt><tt>\centerline {\strut}</tt><tt><br>
</tt><tt>\centerline {\redpieces \char "1FA60\relax \ \char "1FA61\relax \ \char "1FA62\relax \ \char "1FA63\relax \ \char "1FA64\relax \ \char "1FA65\relax \ \char "1FA66\relax}</tt><tt><br>
</tt><tt>\centerline {\strut}</tt><tt><br>
</tt><tt>\centerline {\blackpieces \char "1FA67\relax \ \char "1FA68\relax \ \char "1FA69\relax \ \char "1FA6A\relax \ \char "1FA6B\relax \ \char "1FA6C\relax \ \char "1FA6D\relax}</tt><tt><br>
</tt><tt>\end</tt></blockquote>
<tt>-- <br>
<i>Philip Taylor</i><br>
</tt><br>
<p>This email, its contents and any attachments are intended solely for the addressee and may contain confidential information. In certain circumstances, it may also be subject to legal privilege. Any unauthorised use, disclosure, or copying is not permitted.
If you have received this email in error, please notify us and immediately and permanently delete it. Any views or opinions expressed in personal emails are solely those of the author and do not necessarily represent those of Royal Holloway, University of
London. It is your responsibility to ensure that this email and any attachments are virus free.</p>
<p></p>
</div>
</blockquote></div>