forked from latex3/fontspec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fontspec-doc-luatex.tex
40 lines (30 loc) · 1.1 KB
/
fontspec-doc-luatex.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
\part{\LuaTeX-only font features}
\label{sec:luatex-features}
\section{Custom font features}
Pre-2016, it was possible to load an OpenType font feature file to define new OpenType features for a selected font. This facility was particularly useful to implement custom substitutions, for example. As of \TeX{}Live~2016, \LuaTeX/\pkg{luaotfload} no longer supports this feature, but provides its own internal mechanisms for an equivalent interface.
Any documents using `feature file' options will need to transition to the new interface.
Figure~\ref{fig:featurefile} shows an example.
Please refer to the \LuaTeX/\pkg{luaotfload} documentation for more details.
\begin{figure}
\caption{An example of custom font features.}
\label{fig:featurefile}
\hrule
\begin{Verbatim}
\documentclass{article}
\usepackage{fontspec}
\directlua{
fonts.handlers.otf.addfeature {
name = "oneb",
type = "substitution",
data = {
["1"] = "one.ss01",
}
}
}
\setmainfont{Vollkorn-Regular.otf}[RawFeature=+oneb]
\begin{document}
1234567890
\end{document}
\end{Verbatim}
\hrule
\end{figure}