Skip to content

Instantly share code, notes, and snippets.

@ezgranet
Last active August 5, 2022 10:20
Show Gist options
  • Select an option

  • Save ezgranet/19d6f117f11e2d27c4572a2e3160389e to your computer and use it in GitHub Desktop.

Select an option

Save ezgranet/19d6f117f11e2d27c4572a2e3160389e to your computer and use it in GitHub Desktop.
etbb parentheses spacing fix
%%%%%%%%
%%%%% Michael sharpe's brilliant typeface `etbb' is a
%%% wonderful adaptation of Edward Tufte's own adaptation of Bembo
%%%%%% However, there is, as part of the font, an overlap between
%%% the opening parenthesis --- ( --- and various letters, most notably J
%% This is aesthetically displeasing, so I used this small snippet
%%%% of XeTeX `interchartoks' to fix the spacing
%%%% Now, (J doesn't overlap!
\XeTeXinterchartokenstate = 1
\newXeTeXintercharclass \mycharclassj
\XeTeXcharclass `\J \mycharclassj
\newXeTeXintercharclass \mycharclasslittlej
\XeTeXcharclass `\j \mycharclasslittlej
\newXeTeXintercharclass \mycharclasst
\newXeTeXintercharclass \mycharclassu
\newXeTeXintercharclass \mycharclassv
\XeTeXcharclass `\T \mycharclasst
\XeTeXcharclass `\U \mycharclassu
\XeTeXcharclass `\V \mycharclassv
\newXeTeXintercharclass \mycharclassp
\XeTeXcharclass `( \mycharclassp
\XeTeXinterchartoks\mycharclassp\mycharclassj={\kern1.5pt }
\XeTeXinterchartoks\mycharclassp\mycharclasslittlej={\kern1.5pt }
\XeTeXinterchartoks\mycharclassp\mycharclasst={\kern0.7pt }
\XeTeXinterchartoks\mycharclassp\mycharclassu={\kern0.7pt }
\XeTeXinterchartoks\mycharclassp\mycharclassv={\kern0.7pt }
@yifengwan
Copy link

Sounds great. I will pay attention to problematic pairs. XeTex is my main tex engine, but I do use LuaTex occasionally. I will keep you posted if I come up with some fixes using Lua filter.

@ezgranet
Copy link
Author

ezgranet commented Aug 5, 2022

Most definitely; I think this is why the endpoint is to modify the kerning itself, so as to maintain maximum compatibility (I mainly use LuaTeX but I have so many older documents using specific XeTeX hacks that cross compatibility is important to me too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment