How to turn on font features with Libertine and LuaLaTeX?

Something like this? (to be compiled under LuaLaTeX or XeLaTeX)

enter image description here

Speaking for myself, I find Ligatures={Common,Rare,Historic}, Numbers=OldStyle easier to read than RawFeature=+liga;+dlig;+hlig;+onum.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}%
   [Ligatures={Common,Rare,Historic}, Numbers=OldStyle]
\begin{document}
0123456789

ff fi fj fl ft ffi ffl fft, tt, ct st

\itshape
ff fi fj fl ft ffi ffl fft, tt, ct st
\end{document}

From page 3 of the libertine package manual:

The option defaultfeatures=... allows the user to add default OpenType features.

You can therefore do this in XeLaTeX or LuaLaTeX:

\documentclass[varwidth, preview]{standalone}
\usepackage[defaultfeatures={Ligatures={Common, Historic, TeX}}
           ]{libertine}

\begin{document}
Test
\end{document}

Test

You can also use another package, such as libertine-otf, with a Ligatures= package option. Or bypass the package entirely and use fontspec.

Tags:

Fonts

Luatex