Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
[doc] extend documentation of path lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-gamma committed Feb 10, 2017
1 parent 894e271 commit ad48092
Showing 1 changed file with 38 additions and 11 deletions.
49 changes: 38 additions & 11 deletions doc/luaotfload-main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
<name character> ::= {\sc all_characters} - ( `(' | `/' | `:' ) ;
\endsyntaxfloat

%% Below guarded space gets borked in index; why‽
\beginsubsection{Prefix -- the \identifier{luaotfload}{ }Way}

In \identifier{luaotfload}, the canonical syntax for font requests
Expand Down Expand Up @@ -335,13 +336,12 @@

\endsubsection

\beginsubsection {Compatibility Layer}

In addition to the regular prefixed requests, \identifier{luaotfload}
accepts loading fonts the \XETEX way.
\beginsubsection {Bracketed Lookups}
\label{sec:conf}
Bracketed lookups allow for arbitrary character content to be used in a
definition.
%
There are again two modes: bracketed and unbracketed.
A bracketed request looks as follows.
A simple bracketed request looks follows the scheme

\beginnarrower
\nonproportional{\string\font\string\fontname\space = [}%
Expand All @@ -350,21 +350,41 @@
\endnarrower

\noindent
Inside the square brackets, every character except for a closing
bracket is permitted, allowing for specifying paths to a font file.
Inside the square brackets, every character except for a closing bracket is
permitted, allowing for arbitrary paths to a font file -- including Windows
style paths with UNC or drive letter prepended -- to be specified.
%
The \identifier{Luaotfload} syntax differs from \XETEX in that the subfont
selector goes \emphasis{after} the closing bracket:

\beginnarrower
\nonproportional{\string\font\string\fontname\space = [}%
\meta{/path/to/file}%
\nonproportional{]}
\nonproportional{(}n\nonproportional{)}
\endnarrower

Naturally, path-less file names are equally valid and processed the
same way as an ordinary \inlinecode {file:} lookup.

\beginsubsection {Compatibility}

In addition to the regular prefixed requests, \identifier{luaotfload}
accepts loading fonts the \XETEX way.
%
There are again two modes: bracketed and unbracketed.
For the bracketed variety, see above, \ref{sec:conf}.

Unbracketed (or, for lack of a better word: \emphasis{anonymous})
font requests resemble the conventional \TEX syntax.

\beginnarrower
\nonproportional{\string\font\string\fontname\space= }%
\meta{font name}
\dots
\endnarrower
\endsubsection

Unbracketed (or, for lack of a better word: \emphasis{anonymous})
font requests resemble the conventional \TEX syntax.
%
However, they have a broader spectrum of possible interpretations:
before anything else, \identifier{luaotfload} attempts to load a
traditional \TEX Font Metric (\abbrev{tfm} or \abbrev{ofm}).
Expand Down Expand Up @@ -443,6 +463,13 @@
\font \cambriamath = "file:cambria.ttc(1)" at 10pt
\endlisting

and likewise, requesting subfont inside a TTC container by path:

\beginlisting
\font \asanamain = "[/home/typesetter/.fonts/math/asana.ttc](0):mode=node;+tlig" at 10pt
\font \asanamath = "[/home/typesetter/.fonts/math/asana.ttc](1):mode=base" at 10pt
\endlisting

\endsubsubsection

\beginsubsubsection{Loading by Font Name}
Expand Down

0 comments on commit ad48092

Please sign in to comment.