For presenting positions in the game of backgammon, there is a commercially developed, but free for personal use,
without modifications, font called eXtremeGammon
. The ttf font file is available from the eXtreme Gammon site
ttf file. I was hoping to use this font for typesetting notes and references using LaTeX. I took the advice from the
accepted answer to an earlier TeX Stackexchange post, Installing TTF fonts in LaTeX, on using ttf fonts in LaTeX by
using XeTeX rather than LaTeX.
I have two problems with this approach:
1) Some characters in the font are not found by XeLaTeX, eg. digraphs and the £ character. The font does work with these
characters outside TeX and the characters do appear with a symbol when studying the ttf file using FontForge. The
following simple example outputs a pdf file from XeLaTeX, but containins only the symbol for the @-character.
\documentclass{article}
\usepackage{fontspec}
\setromanfont{eXtremeGammon}
\begin{document}
ñ © @ £
\end{document}
The only thing I can understand as related in the log file is these lines:
Missing character: There is no ñ in font eXtreme Gammon/ICU!
Missing character: There is no © in font eXtreme Gammon/ICU!
Missing character: There is no £ in font eXtreme Gammon/ICU!
I tried using the tip from this earlier posting related to inputting characters to XeLaTeX Foreign characters in XeLaTeX, but it did not change anything for me.
2) The goal is to be able to typeset positions with end result as in this picture
which is an image of how browsers render the font. The font works by individual characters being eg. a black disc on the middle fifth of a downward triangle with white background, a white disc on the lowest fifth of an upward triangle with lined background or eg. a part of the playing frame. In order to have the characters "connect" and not have holes in the resulting position I add \offinterlineskip
. However, this still leaves very thin horizontal empty lines in the diagram after some lines. Here is a simple example that draws a downward white triangle using the font. The spacing is better but not quite right at all lines, even with \offinterlineskip
\documentclass{article}
\usepackage{fontspec}
\setromanfont{eXtremeGammon}
\begin{document}
\offinterlineskip %% Still leaves thin vertical lines of empty space
%% after some lines. Problem in font itself ?
\noindent
A\\
B\\
C\\
D\\
E
\end{document}
Here is image of the triangle in the pdf output with thin empty lines in two spots:
A last note is that the eg. the triangles does not look nearly as "sharp" as in a browser when it is rendered using a CSS sheet with @font-face
, so perhaps this overall strategy on how to typeset these positions in TeX is flawed ?
UPDATE: Regarding part 1) I tried running Leo Liu's answer to Generating a table of glyphs with XeLaTeX and it turns out that only for values i in the range from 32 to 160 are there any for which \iffontchar\font\i
is true
despite there being more characters with symbols in the ttf font then the number of trues here. I haven't worked much with LaTeX and fonts but I am starting to think if this could be some sort of encoding problem ? The following
post could be relevant Font has glyph but XeLaTeX reports "Missing character". How would I check the following from the last comment in that post: if this font is to old and doesn't use unicode ?
Best Answer
Since I like to play backgammon, this seemed like a useful thing to do. Here's an initial version of a backgammon display package. This is pretty rough, and I expect to update it, but it's pretty usable in its present state. Obviously it still needs some documentation, and there may be a few features missing.
Update
The package described below is currently being developed and is not yet officially released. The latest version of the code can be obtained from GitHub. Comments welcome.
tikz-backgammon.sty
Put this in your local texmf folder:
Sample document
Output