3

I haven't used chessboard for a long time. I'm wondering how I can use it with LuaLaTeX and my own chess fonts. Can someone help me with an example file? I'm having especially troubles how to let LuaLaTeX know about my fonts.

I've tried this:

\documentclass{book}%%% De Morbis Typographorum
\usepackage{luaotfload}
\usepackage[LSBC4,T1,LY1]{fontenc}
\usepackage{chessfss,chessboard}
\usepackage{skak}
\usepackage{fontspec}
\newfontface\NeuhausenDiagram{Neuhausen-Diagram4.pfb}
\newcommand\Chessboard[1]{%
   \begin{center}
   \chessboard[setfen=#1]
   \end{center}
   \par
   \@afterindentfalse\@afterheading%
}
\setboardfontfamily{neuhausen}
\setsidefontencoding{LY1}
\setsidefontfamily{KievitPro-TLF}
\setsidefontseries{m}
\setsidefontshape{n}
\setchessboard{%
   boardfontencoding=LSBC4,
   boardfontsize=18bp,
   %labelright=true, labeltop=true,
   labelleft=false,
   labelright,
   labelrightwidth=3.0mm, %labeltoplift=1.25mm,
   labelbottomlift=3.5mm,
   marginwidth=14.4bp, marginbottomwidth=14.4bp,
%   marginleftwidth=13bp,
   labelfontsize=8bp,
%   borderwidth=.3mm,
%   bordercolor=red,
   border=false,
   linewidth=0.25mm, padding=0mm, pgfborder,
   linewidth=0.35mm, padding=0.7mm, pgfborder,
   showmover=false,
   blackfieldmaskcolor=black!25,
   setfontcolors
}
\begin{document}
\setchessboard{boardfontseries=r}
\Chessboard{bKN5/B7/pPP1R1n1/Q4p2/2k5/2p3p1/3p1R2/nr1N3B w - - 0 1}
\end{document}

But got an error message that LuaLaTeX cannot find the font Neuhausen-Diagram4.pfb

Any help appreciated!

Ulrich

  • 1
    Try converting your .pfb file to .otf (FontForge is one program that can do this). – Thérèse Jun 27 '18 at 14:08
  • That's more a problem of lualatex not being able to handle pfb directly (without tfm). If you have a tfm and the font is correctly encoded it should work like with pdflatex. – Ulrike Fischer Jun 27 '18 at 14:31
  • Regarding otf/ttf: the main problem is here that unicode hasn't positions for board glyphs, only figurines. So it is not quite clear, how to encode them. Btw if you want to see a special chess font github.com/u-fischer/lua-font-pond/blob/master/latex/…. – Ulrike Fischer Jun 27 '18 at 14:36
  • so I should stick to pdflatex and type-1 fonts, Ulrike? – Ulrich Dirr Jun 27 '18 at 16:11
  • yes I have both tfm, pfb, and fd files for the font. But I can't remember how to tell lualatex to use them (I put them in my local folder and updated the file name database and updmap). Probably I did something wrong here. It's just too long ago I'd used TeX :-( – Ulrich Dirr Jun 27 '18 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.