# LuaLaTeX + fontspec + IM FELL not providing long s

I'm attempting to get a font (any font) which automatically switches s for ſ in the middle of words. Following a number of suggestions I've found on StackExchange, I'm using IM FELL DW Pica PRO (from here). I'm currently using LuaLaTeX under MikTeX.

Based on the example here, here is a MWE:

\documentclass{article}
\usepackage{fontspec}

\begin{document}
\font\1="IM FELL DW Pica PRO:mapping=tex-text,+dlig,+hlig,+hist" at 12pt
\1 Associated facts stray speciously.

1234567890
\end{document}


For me, this outputs:

However, in the original post, it's meant to output:

Is this a flaw with LuaLaTeX (like suggested here)? Using this question, I listed all font features for IM FELL DW Pica PRO, and hlig is not mentioned, even though it's used in the above code.

Any help would be highly appreciated.

For OpenType fonts, the availabilty and behaviour of features like hist depend on the script and the language.

By default, LuaLaTeX uses the default script (DFLT) and the default language (dflt). For some reason this script does not exists in "IM FELL DW Pica PRO", so none of the features exists. IMHO this is a bug in the font, but it is not a big problem: You just have to specify that you use latin script (latn) by adding the option script=latn.

Additionally you can drop fontspec if you are not using it and as hlig can be omitted because there is no such feature in the font.

This leaves:

\documentclass{article}

\begin{document}
\font\IMFell="IM FELL DW Pica PRO:script=latn,+tlig,+dlig,+hist" at 12pt
% Or, if you prefer filenames
%\font\IMFell="[IMFePIrm29C.otf]:script=latn,+tlig,+dlig,+hist" at 12pt
\IMFell Associated facts stray speciously.

1234567890
\end{document}


You probably want to use the font-loading commands from fontspec. Specifically, the long s (ſ) is contextually enabled by Style = Historic. You can turn off the ligature ss → ſs → ß by removing Discretionary from Ligatures. There are also a few different stylistic sets you can use if you want to automatically turn oe → œ and ae → æ.

If you compile with LuaLaTeX, microtype will turn on font expansion and greatly reduce the amount of hyphenation you need. I’ve had people dislike how this looked on a laser printer, but it’s a big win for reading on a screen.

I’ve chosen a slightly anachronistic passage to illustrate the font features, from The London Quarterly Review of June 1839.

\documentclass[varwidth=10cm, preview]{standalone}
\usepackage{fontspec}
\usepackage{microtype}

\defaultfontfeatures{Scale = MatchUppercase, Ligatures = TeX}
\setmainfont{IMFePI}[
Scale = 1.0 ,
Ligatures = { Common, Discretionary } ,
UprightFont = *rm29C ,
UprightFeatures = { Style = Historic } ,
ItalicFont = *it29C ,
ItalicFeatures = { Style = {Historic, Swash} } ,
Extension = .otf ]

\begin{document}

\textit{Oliver Twist}, again, is directed against the poor-law and work-house systems, and in our opinion with much unfairness.  The abuses which he ridicules are not only much exaggerated, but in nineteen cases out of twenty do not at all exist.  Boz so rarely mixes up politics, or panders to vulgar prejudices about serious things, that we reget to see him participate in an outcry which is partly factious, partly sentimental, partly interested.  The besetting sin of white-waistcoated' guardians is profusion, not parsimony; and this always must be the case where persons have to be generous out of funds to which individually they are small contributors.  After all, the proof of the pudding is in the eating: one week's poorhouse pot-luck fattens a pauper brat up to such a sucking-pig nicety, that its own parent, like Saturn, longs to eat it up with more than kisses.

\end{document}


• Note that you don't need the \defaultfontfeatures{Scale = MatchUppercase, Ligatures = TeX} line. The fontspec package now enables TeX ligatures automatically, and Scale = MatchUppercase will scale the main font against Latin Modern, which usually isn't what one wants. – Andrew Dunning Jan 21 at 16:38
• @AndrewDunning The Ligaturee = TeX part is now the default, yes. I often leave it out. A \setmainfont also automatically sets Ligatures = Common, too. In this case, I set Scale = 1.0 on the main font. So, Scale = MatchUppercase scales every other font loaded by fontspec to the main font. You’re correct, though, that there are no other fonts in this example. So it has no effect here. I only left it in out of habit—excuse me, I meant, as an example of best practice! – Davislor Jan 21 at 17:58

To use the IM Fell types, you can set up fontspec to use not only their extra ligatures but also their optical sizes:

\documentclass{article}
\usepackage{fontspec,microtype}

\setmainfont{IMFe}[%
UprightFont = *PIrm29C,
ItalicFont = *PIit29C,
Extension = .otf,
Ligatures = {Common, Rare},
Style = {Historic, Swash},
UprightFeatures={
SizeFeatures={
{Size={-12.59},     Font=*PIrm29C}, % De Walpergen Pica = 12.5pt
{Size={12.6-15.25}, Font=*ENrm29C}, % English = 13.5pt
{Size={15.26-18.99},Font=*GPrm29C}, % Great Primer = 17pt
{Size={19-29.99},   Font=*DPrm29C}, % Double Pica = 21pt
{Size={30-43.49},   Font=*FCrm29C}, % French Canon = 39pt
{Size={43.5-},      Font=*TLrm29C}, % Three Line Pica = 48pt
},
},
ItalicFeatures={
SizeFeatures={
{Size={-12.59},     Font=*PIit29C}, % De Walpergen Pica = 12.5pt
{Size={12.6-15.25}, Font=*ENit29C}, % English = 13.5pt
{Size={15.26-18.99},Font=*GPit29C}, % Great Primer = 17pt
{Size={19-29.99},   Font=*DPit29C}, % Double Pica = 21pt
{Size={30-},        Font=*FCit29C}, % French Canon = 39pt
},
},
]

\begin{document}

Associated facts stray speciously.

1234567890

\end{document}


If you're looking for other fonts that provide a long ſ, Junicode is another candidate, with a great collection of optional ligatures:

\documentclass{article}
\usepackage{fontspec,microtype}

\setmainfont{Junicode}[
Ligatures = {Common, Rare, Historic},
Style = {Historic},
Numbers = {Lowercase, Proportional}
]

\begin{document}

Associated facts stray speciously.

1234567890

\end{document}
`