[XeTeX] XeTeX/XeLaTeX and bi-color fonts
Peter Baker
psb6m at virginia.edu
Sun Oct 18 17:30:20 CEST 2009
John Was wrote:
> Hi
>
> If all you need to do is to superimpose two pieces of identical text
> in different fonts, is there anything to stop you using simple \llap
> in your header definition?
>
> If you have the fonts already defined as \fontone and \fonttwo, the
> text for your header could go into a simple control sequence:
>
> \def\headertext#1{\fontone#1\llap{\fonttwo#1}}
>
> And when the text for the header is encountered in your document just
> surround it with the control sequence:
>
> \headertext{This is the Text for the Headline}
>
>
That's it! And of course it's easy to create an equivalent using just
\llap and LaTeX commands. This worked for me (though it is surely crude):
%&program=xelatex
%&encoding=UTF-8 Unicode
\documentclass[11pt,letterpaper,twoside,openany]{book}
\usepackage{xltxtra}
\usepackage{color}
\setmainfont{Eadui}
\defaultfontfeatures{Mapping=tex-text}
\newcommand{\filltext}[2]{{\fontspec{EaduiFill}\color{#1}#2%
\llap{\fontspec{Eadui}\color{black}#2}}}
\begin{document}
\huge
\noindent
\filltext{red}{A}rma uirumque cano.
\noindent
\filltext{yellow}{D}oes it work \filltext{blue}{E}lsewhere in the line? Yes!
\end{document}
What I'm after here is to reproduce an effect popular with medieval
scribes of filling the counters and concavities of initials with color.
Anyone wanting to know what the effect looks like can see it here:
http://gouldbaker.net/filltest.pdf
Thanks very much to John and Fr. Michael!
Peter
More information about the XeTeX
mailing list