2

How can I change the kerning of specific small caps, specifically w and v in combination with dot and comma?

With XeTeX, I found out how to change upper and lowercases, but no luck with small caps unicode number, at least with Fanwood Text, Junicode or EB Garamond.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Junicode}
\XeTeXinterchartokenstate=1
\newXeTeXintercharclass\fooV
\newXeTeXintercharclass\foov
\newXeTeXintercharclass\fooDot
\XeTeXcharclass "56=\fooV % Capital V
\XeTeXcharclass "76=\foov % Lowercase V
\XeTeXcharclass "F776=\foov % Small Cap v in Junicode
\XeTeXcharclass "2C=\fooDot % Comma
\XeTeXcharclass "2E=\fooDot % Dot
\XeTeXinterchartoks\fooV\fooDot{\kern-.12em}
\XeTeXinterchartoks\foov\fooDot{\kern-.06em}

\begin{document}
    EV,
    ev,
    \textsc{ev},
\end{document}

enter image description here

0

1 Answer 1

5

You need to include the comma within the scope of the command which switches the font. Kerning has no meaning between fonts and small-caps is essentially a different font as far as TeX is concerned. (I'm not sure quite how this goes for the newer engines, though.)

adjusted kerning

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Junicode}
\XeTeXinterchartokenstate=1
\newXeTeXintercharclass\fooV
\newXeTeXintercharclass\foov
\newXeTeXintercharclass\fooDot
\XeTeXcharclass "56=\fooV % Capital V
\XeTeXcharclass "76=\foov % Lowercase V
\XeTeXcharclass "F776=\foov % Small Cap v in Junicode
\XeTeXcharclass "2C=\fooDot % Comma
\XeTeXcharclass "2E=\fooDot % Dot
\XeTeXinterchartoks\fooV\fooDot{\kern-.12em}
\XeTeXinterchartoks\foov\fooDot{\kern-.06em}

\begin{document}
  EV,
  ev,
  \textsc{ev},
  \textsc{ev,}
\end{document}
2
  • It makes sense... but now I realize that it's going to be a huge problem, because I wanted to modify this kerning pair for a biblatex shorthand I'm using a lot on a document. The output is something like MEW, 8, p. 107. MEW stands for Marx-Engels Werke.
    – Ludenticus
    Jan 3, 2015 at 5:36
  • @Ludenticus I think you should post a new question in that case as it is going to raise different issues. You can link to this one as part of that question.
    – cfr
    Jan 3, 2015 at 13:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .