blob: d8a16d565449cc4a7483c345955dad6f8edf6f2b (
plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
%%^^A%% fontspec-doc-luatex.tex -- part of FONTSPEC <wspr.io/fontspec>
\documentclass[a4paper]{l3doc}
\usepackage{fontspec-doc-style}
\showexamplesfalse
\begin{document}
\part{\LuaTeX-only font features}
\label{sec:luatex-features}
\section{Custom font features}
\LuaTeX, via the \pkg{luaotfload} package, allows the definition and re-definition of custom OpenType features for a selected font. This facility is particularly useful to implement custom substitutions or to disable unwanted but not all ligatures.
Figure~\ref{fig:featurefile} shows an minimal example of this type of functionality.
A third-party collection of additional examples are maintained in the repository `\texttt{fonts-in-luatex}'\footnote{\url{https://github.com/mewtant/fonts-in-luatex}}.
These examples are intended to correct or adjust font features in a range of commercial fonts and provide a good introduction to some of the possibilities that \LuaTeX\ affords.
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}
\end{document}
% /©
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
% Copyright 2004-2019 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
% Copyright 2013-2016 Joseph Wright
% ------------------------------------------------
% This package is free software and may be redistributed and/or modified under
% the conditions of the LaTeX Project Public License, version 1.3c or higher
% (your choice): <http://www.latex-project.org/lppl/>.
% ------------------------------------------------
% ©/
|