I am creating a blackletter font and would like to use it with XeLaTeX. I try to use initial/medial/final substitution for letters, like s/ſ, but the context seems to match even when it should not.

For example, I try to execute substitution of s by ſ using the init and medi tables, but with fontspec and Contextuals={Inner}, word-initial and -final “s”es are replaced by “ſ”, too. The corresponding applies for all substitutions of initial and final forms.


gives a document containing ſmſtſmſ in the correct font, instead of smſtſms, as I would expect.

Am I doing something wrong? How does XeLaTeX decide if a letter is initial, medial or final?

  • I ignored this problem now by making Jena1330 fit for vanilla pdfLaTeX, by using a manually generated pl/tfm file. (., , and so on are still considered part of the word there, though.) – Anaphory Aug 11 '12 at 0:33

Most OpenType layout engine handle isol/init/medi/fina properly only for specific scripts (Arabic, Syriac, Mongolian, etc.), for other scripts they will apply them unconditionally, which seems to be the case with the ICU layout engine used by XeTeX. AFAIK, only some Adobe applications handle them for Latin script.

For better compatibility, you should implement it using contextual substitutions.

  • So for compatibility with both LuaLaTeX and XeLaTeX I have to implement them as both calt and init/medi/fina, since LuaLaTeX has a problem with calt, but supports the in-word contexts for Latin script. – Anaphory May 12 '12 at 9:16
  • I'm surprised that they work with LuaLaTeX, AFAIK as I know it doesn’t, the calt issue might be a bug, but without the actual font I can’t help much. – Khaled Hosny May 12 '12 at 9:47
  • They mostly work with LuaLaTex. As in this other question, I see that “…s,” is replaced by “…ſ,”, even though “,” is not a letter. – Anaphory May 12 '12 at 10:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.