# [XeTeX] Adressing the long s

Jonathan Kew jonathan at jfkew.plus.com
Sun Aug 10 13:19:32 CEST 2008

On 10 Aug 2008, at 10:39 AM, Albert Kapune wrote:
>
> I have several fonts with a long s at position U+017F.
> Unfortunately, I
> did not find a way to use it in my documents via fontspec.sty.
>
> The following example performs the normal »s«:
>
> \documentclass{scrartcl}
> \usepackage{xunicode}
> \usepackage{xltxtra}
> \usepackage{fontspec}
> \setmainfont[Scale=MatchLowercase,Contextuals=Inner]{MS Mincho}
> \begin{document}
> Wassernuss, Wassernüsse
> \end{document}
>
> I have fontspec 1.7 under the actual MiKTeX environment.

This would only work if the font contained OpenType lookups
implementing the s -> ſ substitution in appropriate contexts. I have
seen this implemented in a few AAT fonts (such as Hoefler Text, IIRC),
but not in OpenType. The "standard" way to produce the ſ is by using
the assigned Unicode character, not as a glyph alternate of "s".

(Whether that's a good thing may be debatable, but it's how things are
encoded in Unicode and so that's what fonts must be expected to
implement.)

Some OpenType fonts implement s -> ſ as a "historical forms" feature,
but in the instances I've seen they do this as an unconditional
substitution, not depending on the context. That makes it useless as a
"global" feature to be enabled as part of your text style; you'd have
to selectively apply the feature only to the letters where you want
the change to be applied.

The best approach use the character U+017F 'ſ' directly in your input
text (or if that's not convenient, use a TeX macro that expands to
it). That is the Unicode-compliant way to represent the data. Trying
to automatically generate 'ſ' where the input text contains 's', using
special font features, may seem like a handy trick but will lead to
more trouble than it's worth.

JK