From cde7add49b05077ff24b6006f031bbdd70c91d7d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 21 Apr 2016 20:55:25 +0000 Subject: luaotfload (21apr16) git-svn-id: svn://tug.org/texlive/trunk@40655 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/luatex/luaotfload/filegraph.dot | 64 +++++-- .../source/luatex/luaotfload/luaotfload-latex.tex | 2 +- .../source/luatex/luaotfload/luaotfload-main.tex | 205 +++++++++++++++------ .../source/luatex/luaotfload/luaotfload-tool.rst | 23 +-- .../source/luatex/luaotfload/luaotfload.conf.rst | 62 ++++--- 5 files changed, 239 insertions(+), 117 deletions(-) (limited to 'Master/texmf-dist/source/luatex/luaotfload') diff --git a/Master/texmf-dist/source/luatex/luaotfload/filegraph.dot b/Master/texmf-dist/source/luatex/luaotfload/filegraph.dot index de6082372f9..b2744618d47 100644 --- a/Master/texmf-dist/source/luatex/luaotfload/filegraph.dot +++ b/Master/texmf-dist/source/luatex/luaotfload/filegraph.dot @@ -309,7 +309,7 @@ strict digraph luaotfload_files { //looks weird with circo ... l-lua.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-file.lua l-boolean.lua l-math.lua - util-str.lua + util-str.lua util-fil.lua >, ] @@ -322,13 +322,17 @@ strict digraph luaotfload_files { //looks weird with circo ... label = < - - - - - - - + + + + + + + + + + +
Font Loader (LuaTeX-Fonts)
luatex-fonts-cbk.lua luatex-basics-nod.lua
luatex-fonts-enc.lua luatex-fonts-syn.lua
luatex-font-tfm.lua luatex-font-afm.lua
luatex-font-afk.lua luatex-fonts-tfm.lua
luatex-fonts-chr.lua luatex-fonts-lua.lua
luatex-fonts-inj.lua luatex-fonts-otn.lua
luatex-fonts-def.lua luatex-fonts-ext.lua
luatex-basics-nod.lualuatex-basics-chr.lua
luatex-fonts-enc.lualuatex-fonts-syn.lua
luatex-fonts-ext.lua
>, ] @@ -341,10 +345,46 @@ strict digraph luaotfload_files { //looks weird with circo ... label = < - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Font and Node Libraries from Context
data-con.lua font-ini.lua font-con.lua
font-cid.lua font-map.lua font-oti.lua
font-otf.lua font-otb.lua font-ota.lua
font-def.lua
data-con.luafont-ini.luafont-con.lua
font-cid.luafont-map.luafont-tfm.lua
font-afm.luafont-afk.luafont-oti.lua
font-otr.luafont-cff.luafont-ttf.lua
font-dsp.luafont-oup.luafont-otl.lua
font-oto.luafont-otj.luafont-ota.lua
font-ots.luafont-osd.luafont-lua.lua
font-def.luafont-xtx.luafont-gbn.lua
>, ] diff --git a/Master/texmf-dist/source/luatex/luaotfload/luaotfload-latex.tex b/Master/texmf-dist/source/luatex/luaotfload/luaotfload-latex.tex index bdcf45f0929..b4cd3c34342 100644 --- a/Master/texmf-dist/source/luatex/luaotfload/luaotfload-latex.tex +++ b/Master/texmf-dist/source/luatex/luaotfload/luaotfload-latex.tex @@ -3,7 +3,7 @@ %% %% by Elie Roux %% and Khaled Hosny -%% and Philipp Gesang +%% and Philipp Gesang %% %% This file is part of Luaotfload. %% diff --git a/Master/texmf-dist/source/luatex/luaotfload/luaotfload-main.tex b/Master/texmf-dist/source/luatex/luaotfload/luaotfload-main.tex index ca1bc96e701..c243f03a007 100644 --- a/Master/texmf-dist/source/luatex/luaotfload/luaotfload-main.tex +++ b/Master/texmf-dist/source/luatex/luaotfload/luaotfload-main.tex @@ -1,8 +1,8 @@ -%% Copyright (C) 2009-2015 +%% Copyright (C) 2009-2016 %% %% by Elie Roux %% and Khaled Hosny -%% and Philipp Gesang +%% and Philipp Gesang %% %% This file is part of Luaotfload. %% @@ -32,7 +32,7 @@ \beginfrontmatter \setdocumenttitle {The \identifier{luaotfload} package} - \setdocumentdate {2015/12/12 v2.6} + \setdocumentdate {2016/04/21 v2.7} \setdocumentauthor {Elie Roux · Khaled Hosny · Philipp Gesang\\ Home: \hyperlink {https://github.com/lualatex/luaotfload}\\ Support: \email {lualatex-dev@tug.org}} @@ -188,9 +188,30 @@ for a more formal description see figure \ref{font-syntax}. ::= , [ ], \{ \} \alt , \{ \} ; - ::= `file:', + ::= `combo:', + \alt `file:', \alt `name:', ; + ::= , \{ `;', \} ; + + ::= , `->', ; + + ::= , `->', ; + + ::= (`(', \{ {\sc digit} \}, `)' | \{ {\sc digit} \} ) ; + + ::= (`(', \{ {\sc digit} \}, `,', , `)' + \alt \{ {\sc digit} \} ) ; + + ::= `fallback' + \alt \{ , \{ `*', \} \} ; + + ::= , [ `-', ] ; + + ::= `0x', \{ {\sc hexdigit} \} + \alt `U+', \{ {\sc digit} \} + \alt \{ {\sc digit} \} ; + ::= \{ \} ; ::= \{ \} ; @@ -227,12 +248,11 @@ requires a \emphasis{prefix}: \endnarrower % where \meta{prefix} is either \inlinecode{file:} or \inlinecode {name:}.\footnote{% - The development version also knows two further prefixes, - \inlinecode {kpse:} and \inlinecode {my:}. + \identifier{Luaotfload} also knows two further prefixes, \inlinecode {kpse:} + and \inlinecode {my:}. % A \inlinecode {kpse} lookup is restricted to files that can be found by - \identifier{kpathsea} and - will not attempt to locate system fonts. + \identifier{kpathsea} and will not attempt to locate system fonts. % This behavior can be of value when an extra degree of encapsulation is needed, for instance when supplying a customized tex distribution. @@ -373,7 +393,7 @@ have no meaning in \LUATEX. \beginsubsubsection{Loading by File Name} -For example, conventional \abbrev{type1} font can be loaded with a +For example, conventional \TeX\ font can be loaded with a \inlinecode {file:} request like so: \beginlisting @@ -584,38 +604,6 @@ obviously, \inlinecode{random}. defaulting to \inlinecode{dflt}. \endaltitem - \beginaltitem {featurefile} - A comma-separated list of feature files to be applied to the - font. - % - Feature files contain a textual representation of - \OpenType tables and extend the features of a font - on fly. - % - After they are applied to a font, features defined in a - feature file can be enabled or disabled just like any - other font feature. - % - The syntax is documented in \identifier{Adobe}’s - \OpenType Feature File Specification.\footnote{% - Cf. \hyperlink {http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html}. - Feature file support is part of the engine which at the - time of this writing (2014) implements the spec only - partially. - See the - \hyperlink [\LUATEX tracker]{http://tracker.luatex.org/view.php?id=231} - for details. - } - - For a demonstration of how to set a \inlinecode{tkrn} feature consult - the file \inlinecode{tkrn.fea} that is part of \identifier{luaotfload}. - It can be read and applied as follows: - - \beginlisting - \font \test = Latin Modern Roman:featurefile=tkrn.fea;+tkrn - \endlisting - \endaltitem - \beginaltitem {color} A font color, defined as a triplet of two-digit hexadecimal \abbrev{rgb} values, with an optional fourth value for @@ -806,6 +794,92 @@ Currently (2014) there are three of them: \endsubsection \endsection +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\beginsection {Combining fonts} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +Version 2.7 and later support combining characters from multiple fonts into a +single virtualized one. This requires that the affected fonts be loaded in +advance as well as a special \emphasis{request syntax}. Furthermore, this +allows to define \emphasis{fallback fonts} to supplement fonts that may lack +certain required glyphs. + +Combinations are created by defining a font using the \luaident{combo:} prefix. + +\beginsubsection {Fallbacks} + +For example, the \identifier{Latin Modern} family of fonts does, as indicated +in the name, not provide Cyrillic glyphs. If Latin script dominates in the copy +with interspersed Cyrillic, a fallback can be created from a similiar looking +font like \identifier{Computer Modern Unicode}, taking advantage of the fact +that it too derives from Knuth’s original \identifier{Computer Modern} series: + +\beginlisting + \input luaotfload.sty + \font \lm = file:lmroman10-regular.otf:mode=base + \font \cmu = file:cmunrm.otf:mode=base + \font \lmu = "combo: 1->\fontid\lm; 2->\fontid\cmu,fallback" + \lmu Eh bien, mon prince. Gênes et Lueques ne sont plus que des + apanages, des поместья, de la famille Buonaparte. + \bye +\endlisting + +As simple as this may look on the first glance, this approach is entirely +inappropriate if more than a couple letters are required from a different font. +Because the combination pulls nothing except the glyph data, all of the +important other information that constitute a proper font -- kerning, styles, +features, and suchlike -- will be missing. + +\endsubsection %% Fallbacks + +\beginsubsection {Combinations} + +Generalizing the idea of a \emphasis{fallback font}, it is also possible to +pick definite sets of glyphs from multiple fonts. On a bad day, for instance, +it may be the sanest choice to start out with \identifier{EB Garamond} italics, +typeset all decimal digits in the bold italics of \identifier{GNU Freefont}, +and tone down the punctuation with extra thin glyphs from \identifier{Source +Sans}: + +\beginlisting + \def \feats {-tlig;-liga;mode=base;-kern} + \def \fileone {EBGaramond12-Italic.otf} + \def \filetwo {FreeMonoBoldOblique.otf} + \def \filethree {SourceSansPro-ExtraLight.otf} + + \input luaotfload.sty + + \font \one = file:\fileone :\feats + \font \two = file:\filetwo :\feats + \font \three = file:\filethree:\feats + + \font \onetwothree = "combo: 1 -> \fontid\one; + 2 -> \fontid\two, 0x30-0x39; + 3 -> \fontid\three, 0x21*0x3f; + + {\onetwothree \TeX—0123456789—?!} + \bye +\endlisting + +\noindent Despite the atrocious result, the example demonstrates well the +syntax that is used to specify ranges and fonts. Fonts are being referred to by +their internal index which can be obtained by passing the font command into the +\texmacro{fontid} macro, e. g. \inlinecode{\fontid\one}, after a font has been +defined. The first component of the combination is the base font which will be +extended by the others. It is specified by the index alone. + +All further fonts require either the literal \inlinecode{fallback} or a list of +codepoint definitions to be appended after a comma. The elements of this list +again denote either single codepoints like \inlinecode{0x21} (referring to the +exclamation point character) or ranges of codepoints (\inlinecode{0x30-0x39}). +Elements are separated by the \identifier{ASCII} asterisk character +(\inlinecode{*}). The characters referenced in the list will be imported from +the respective font, if available. + +\endsubsection %% Combinations + +\endsection + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \beginsection {Font names database} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1160,6 +1234,7 @@ and have thus been omitted from the merge.\footnote{% \beginaltitem {l-boolean.lua} \endaltitem \beginaltitem {l-math.lua} \endaltitem \beginaltitem {util-str.lua} \endaltitem + \beginaltitem {util-fil.lua} \endaltitem \enddefinitions \enddoublecolumns @@ -1169,30 +1244,28 @@ grouped twofold as below: \begindefinitions \beginnormalitem The \emphasis{font loader} itself. - These files have been written for - \LUATEX-Fonts and they are distributed along - with \identifier{luaotfload}. + These files have been written for \LUATEX-Fonts and they are + distributed along with \identifier{luaotfload} so as to resemble + the state of the code when it was imported. Their purpose is either + to give a slightly aged version of a file if upstream considers + latest developments for not yet ready for use outside Context; or, + to install placeholders or minimalist versions of APIs relied upon + but usually provided by parts of Context not included in the + fontloader. \begindoublecolumns \begindefinitions \beginaltitem{luatex-basics-nod.lua} \endaltitem + \beginaltitem{luatex-basics-chr.lua} \endaltitem \beginaltitem{luatex-fonts-enc.lua} \endaltitem \beginaltitem{luatex-fonts-syn.lua} \endaltitem - \beginaltitem{luatex-fonts-tfm.lua} \endaltitem - \beginaltitem{luatex-fonts-chr.lua} \endaltitem - \beginaltitem{luatex-fonts-lua.lua} \endaltitem - \beginaltitem{luatex-fonts-inj.lua} \endaltitem - \beginaltitem{luatex-fonts-otn.lua} \endaltitem - \beginaltitem{luatex-fonts-def.lua} \endaltitem \beginaltitem{luatex-fonts-ext.lua} \endaltitem - \beginaltitem{luatex-fonts-cbk.lua} \endaltitem \enddefinitions \enddoublecolumns \endnormalitem \beginnormalitem - Code related to \emphasis{font handling and - node processing}, taken directly from - \CONTEXT. + Code related to \emphasis{font handling and node processing}, taken + directly from \CONTEXT. \begindoublecolumns \begindefinitions \beginaltitem{data-con.lua} \endaltitem @@ -1200,12 +1273,25 @@ grouped twofold as below: \beginaltitem{font-con.lua} \endaltitem \beginaltitem{font-cid.lua} \endaltitem \beginaltitem{font-map.lua} \endaltitem + \beginaltitem{font-tfm.lua} \endaltitem + \beginaltitem{font-afm.lua} \endaltitem + \beginaltitem{font-afk.lua} \endaltitem \beginaltitem{font-oti.lua} \endaltitem - \beginaltitem{font-otf.lua} \endaltitem - \beginaltitem{font-otb.lua} \endaltitem + \beginaltitem{font-otr.lua} \endaltitem + \beginaltitem{font-cff.lua} \endaltitem + \beginaltitem{font-ttf.lua} \endaltitem + \beginaltitem{font-dsp.lua} \endaltitem + \beginaltitem{font-oup.lua} \endaltitem + \beginaltitem{font-otl.lua} \endaltitem + \beginaltitem{font-oto.lua} \endaltitem + \beginaltitem{font-otj.lua} \endaltitem \beginaltitem{font-ota.lua} \endaltitem + \beginaltitem{font-ots.lua} \endaltitem + \beginaltitem{font-osd.lua} \endaltitem + \beginaltitem{font-lua.lua} \endaltitem \beginaltitem{font-def.lua} \endaltitem - \beginaltitem{font-otp.lua} \endaltitem + \beginaltitem{font-xtx.lua} \endaltitem + \beginaltitem{font-gbn.lua} \endaltitem \enddefinitions \enddoublecolumns \endnormalitem @@ -1248,8 +1334,8 @@ files not contained in the merge. Some of these have no equivalent in overrides the \CONTEXT logging functionality. \endaltitem \beginaltitem {luaotfload-loaders.lua} - registers the \OpenType font reader as handler for Postscript - fonts (\abbrev{pfa}, \abbrev{pfb}). + registers readers in the fontloader for various kinds of + font formats \endaltitem \beginaltitem {luaotfload-parsers.lua} various \abbrev{lpeg}-based parsers. @@ -1767,3 +1853,4 @@ Distributions probably package it as \fileent \endinput +% vim:ft=tex:tw=79:et:sw=2 diff --git a/Master/texmf-dist/source/luatex/luaotfload/luaotfload-tool.rst b/Master/texmf-dist/source/luatex/luaotfload/luaotfload-tool.rst index 4c05c44a812..b5cbe96e3e3 100644 --- a/Master/texmf-dist/source/luatex/luaotfload/luaotfload-tool.rst +++ b/Master/texmf-dist/source/luatex/luaotfload/luaotfload-tool.rst @@ -6,9 +6,9 @@ generate and query the Luaotfload font names database ----------------------------------------------------------------------- -:Date: 2015-12-09 +:Date: 2016-04-21 :Copyright: GPL v2.0 -:Version: 2.6 +:Version: 2.7 :Manual section: 1 :Manual group: text processing @@ -80,22 +80,19 @@ update mode system fonts if they are installed in both. --formats=EXTENSIONS Extensions of the font files to index. Where *EXTENSIONS* is a comma-separated list of - supported file extensions (otf, ttf, ttc, - dfont, pfa, and pfb). If the list is prefixed + supported file extensions (otf, ttf, ttc). + If the list is prefixed with a ``+`` sign, the given list is added to the currently active one; ``-`` subtracts. - Default: *otf,ttf,ttc,dfont*. + Default: *otf,ttf,ttc*. Examples: 1) ``--formats=-ttc,ttf`` would skip TrueType fonts and font collections; 2) ``--formats=otf`` would scan only OpenType files; - 3) ``--formats=+pfb`` includes binary - Postscript files. **Warning**: with a - standard TeX Live installation this will - grow the database considerably and slow down - font indexing. + 3) ``--formats=+afm`` includes binary + Postscript files accompanied by an AFM file. query mode ----------------------------------------------------------------------- @@ -116,9 +113,6 @@ query mode For the meaning of the returned fields see the LuaTeX documentation. (requires ``--find``). ---warnings, -w Print the warnings generated by the fontloader - library (assumes ``-I``). Automatically enabled - if the verbosity level exceeds 2. --list=CRITERION Show entries, where *CRITERION* is one of the following: @@ -329,6 +323,5 @@ AUTHORS The fontloader code is provided by Hans Hagen of Pragma ADE, Hasselt NL (``__). -This manual page was written by Philipp Gesang -. +This manual page was written by Philipp Gesang . diff --git a/Master/texmf-dist/source/luatex/luaotfload/luaotfload.conf.rst b/Master/texmf-dist/source/luatex/luaotfload/luaotfload.conf.rst index d624e00f729..e7cbccba4a6 100644 --- a/Master/texmf-dist/source/luatex/luaotfload/luaotfload.conf.rst +++ b/Master/texmf-dist/source/luatex/luaotfload/luaotfload.conf.rst @@ -6,9 +6,9 @@ Luaotfload configuration file ----------------------------------------------------------------------- -:Date: 2015-12-09 +:Date: 2016-04-21 :Copyright: GPL v2.0 -:Version: 2.6 +:Version: 2.7 :Manual section: 5 :Manual group: text processing @@ -33,7 +33,7 @@ A small Luaotfload configuration file with few customizations could look as follows: :: [db] - formats = afm, pfa, pfb + formats = afm,ttf compress = false [misc] @@ -43,10 +43,9 @@ look as follows: :: log-level = 6 This will make Luaotfload ignore all font files except for PostScript -formats. NB: With a default Tex Live install the PS fonts will take -much longer to index than OpenType or TrueType ones. Also, an +binary fonts with a matching AFM file, and Truetype fonts. Also, an uncompressed index file will be dumped which is going to be much larger -due to the huge amount of PostScript fonts indexed. The terminal width +than the default gzip’ed index. The terminal width is truncated to 60 characters which influences the verbose output during indexing. Finally, the verbosity is increased greatly: each font file being processed will be printed to the stdout on a separate line, @@ -126,23 +125,25 @@ the variable is unset. Section ``db`` ----------------------------------------------------------------------- -+---------------+--------+---------------------------+ -| variable | type | default | -+---------------+--------+---------------------------+ -| compress | b | ``true`` | -+---------------+--------+---------------------------+ -| formats | s | ``"otf,ttf,ttc,dfont"`` | -+---------------+--------+---------------------------+ -| max-fonts | n | ``2^51`` | -+---------------+--------+---------------------------+ -| scan-local | b | ``false`` | -+---------------+--------+---------------------------+ -| skip-read | b | ``false`` | -+---------------+--------+---------------------------+ -| strip | b | ``true`` | -+---------------+--------+---------------------------+ -| update-live | b | ``true`` | -+---------------+--------+---------------------------+ ++-----------------+--------+---------------------------+ +| variable | type | default | ++-----------------+--------+---------------------------+ +| compress | b | ``true`` | ++-----------------+--------+---------------------------+ +| formats | s | ``"otf,ttf,ttc"`` | ++-----------------+--------+---------------------------+ +| max-fonts | n | ``2^51`` | ++-----------------+--------+---------------------------+ +| scan-local | b | ``false`` | ++-----------------+--------+---------------------------+ +| skip-read | b | ``false`` | ++-----------------+--------+---------------------------+ +| strip | b | ``true`` | ++-----------------+--------+---------------------------+ +| update-live | b | ``true`` | ++-----------------+--------+---------------------------+ +| use-fontforge | b | ``false`` | ++-----------------+--------+---------------------------+ The flag ``compress`` determines whether the font index (usually ``luaotfload-names.lua[.gz]`` will be stored in compressed forms. @@ -155,15 +156,13 @@ The list of ``formats`` must be a comma separated sequence of strings containing one or more of these elements: * ``otf`` (OpenType format), -* ``ttf`` and ``ttc`` (TrueType format), -* ``dfont`` (Macintosh TrueType format), +* ``ttf`` and ``ttc`` (TrueType format), * ``afm`` (Adobe Font Metrics), -* ``pfb`` and ``pfa`` (PostScript format). It corresponds loosely to the ``--formats`` option to **luaotfload-tool**. Invalid or duplicate members are ignored; if the list does not contain any useful identifiers, the default list -``"otf,ttf,ttc,dfont"`` will be used. +``"otf,ttf,ttc"`` will be used. The variable ``max-fonts`` determines after processing how many font files the font scanner will terminate the search. This is useful for @@ -189,6 +188,10 @@ If ``update-live`` is set, Luaotfload will reload the database if it cannot find a requested font. Those who prefer to update manually using **luaotfload-tool** should unset this flag. +The option ``use-fontforge`` switches name scanning back to the old +method that relies on the builtin ``fontloader`` library. This is +interesting for reference until the Fontforge code will be removed +eventually. Section ``default-features`` ----------------------------------------------------------------------- @@ -293,7 +296,7 @@ restore the previous behavior if necessary. The ``definer`` allows for switching the ``define_font`` callback. Apart from the default ``patch`` one may also choose the ``generic`` one that comes with the vanilla fontloader. Beware that this might -break tools like Fontspect that rely on the ``patch_font`` callback +break tools like Fontspec that rely on the ``patch_font`` callback provided by Luaotfload to perform important corrections on font data. The fontloader backend can be selected by setting the value of @@ -381,6 +384,5 @@ AUTHORS *Luaotfload* is maintained by the LuaLaTeX dev team (``_). -This manual page was written by Philipp Gesang -. +This manual page was written by Philipp Gesang . -- cgit v1.2.3