Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{Script=Latin,Language=German,Contextuals=Inner}
\setmainfont{Jena1330.otf}
\begin{document}
smstsms
\end{document}

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?

share|improve this question
    
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
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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