summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--doc/luaotfload-main.tex40
-rw-r--r--doc/luaotfload-tool.rst15
-rw-r--r--doc/luaotfload.conf.rst15
-rw-r--r--misc/luaotfload.conf.example2
-rw-r--r--src/luaotfload-configuration.lua4
-rw-r--r--src/luaotfload-database.lua75
-rw-r--r--src/luaotfload-loaders.lua1
-rw-r--r--src/luaotfload-main.lua6
-rw-r--r--src/luaotfload.sty6
10 files changed, 61 insertions, 107 deletions
diff --git a/NEWS b/NEWS
index ef593b4..13c288e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,13 +1,13 @@
Change History
--------------
-2016/mm/dd, luaotfload v2.7:
+2016/04/21, luaotfload v2.7:
* Rework lookup chaining.
* Combining glyphs from different fonts (``combo: ...`` requests).
* Glyph fallbacks.
* Latest fontloader code.
* Adapt packaging to changed upstream file layout.
* Remove support for builtin Fontforge libraries (this includes the PFA,
- PFB, and feature file readers).
+ PFB, DFONT, and feature file readers).
2015/12/09, luaotfload v2.6
* Add ``sign`` target to makefile for automated package signing.
diff --git a/doc/luaotfload-main.tex b/doc/luaotfload-main.tex
index c418991..c243f03 100644
--- a/doc/luaotfload-main.tex
+++ b/doc/luaotfload-main.tex
@@ -32,7 +32,7 @@
\beginfrontmatter
\setdocumenttitle {The \identifier{luaotfload} package}
- \setdocumentdate {2016/04/07 v2.7}
+ \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}.
<specification> ::= <prefixed spec>, [ <subfont no> ], \{ <modifier> \}
\alt <anon lookup>, \{ <modifier> \} ;
- <prefixed spec> ::= `file:', <file lookup>
+ <prefixed spec> ::= `combo:', <combo list>
+ \alt `file:', <file lookup>
\alt `name:', <name lookup> ;
+ <combo list> ::= <combo def 1>, \{ `;', <combo def> \} ;
+
+ <combo def 1> ::= <combo id>, `->', <combo id> ;
+
+ <combo def> ::= <combo id>, `->', <combo id chars> ;
+
+ <combo id> ::= (`(', \{ {\sc digit} \}, `)' | \{ {\sc digit} \} ) ;
+
+ <combo id chars> ::= (`(', \{ {\sc digit} \}, `,', <combo chars>, `)'
+ \alt \{ {\sc digit} \} ) ;
+
+ <combo chars> ::= `fallback'
+ \alt \{ <combo range>, \{ `*', <combo range> \} \} ;
+
+ <combo range> ::= <combo num>, [ `-', <combo num> ] ;
+
+ <combo num> ::= `0x', \{ {\sc hexdigit} \}
+ \alt `U+', \{ {\sc digit} \}
+ \alt \{ {\sc digit} \} ;
+
<file lookup> ::= \{ <name character> \} ;
<name lookup> ::= \{ <name character> \} ;
@@ -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
@@ -784,6 +804,8 @@ 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
@@ -1312,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.
diff --git a/doc/luaotfload-tool.rst b/doc/luaotfload-tool.rst
index 5b834b4..b5cbe96 100644
--- a/doc/luaotfload-tool.rst
+++ b/doc/luaotfload-tool.rst
@@ -6,7 +6,7 @@
generate and query the Luaotfload font names database
-----------------------------------------------------------------------
-:Date: 2016-04-18
+:Date: 2016-04-21
:Copyright: GPL v2.0
:Version: 2.7
:Manual section: 1
@@ -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
-----------------------------------------------------------------------
diff --git a/doc/luaotfload.conf.rst b/doc/luaotfload.conf.rst
index 25f5a5c..e7cbccb 100644
--- a/doc/luaotfload.conf.rst
+++ b/doc/luaotfload.conf.rst
@@ -6,7 +6,7 @@
Luaotfload configuration file
-----------------------------------------------------------------------
-:Date: 2016-04-18
+:Date: 2016-04-21
:Copyright: GPL v2.0
:Version: 2.7
:Manual section: 5
@@ -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,
@@ -131,7 +130,7 @@ Section ``db``
+-----------------+--------+---------------------------+
| compress | b | ``true`` |
+-----------------+--------+---------------------------+
-| formats | s | ``"otf,ttf,ttc,dfont"`` |
+| formats | s | ``"otf,ttf,ttc"`` |
+-----------------+--------+---------------------------+
| max-fonts | n | ``2^51`` |
+-----------------+--------+---------------------------+
@@ -158,14 +157,12 @@ containing one or more of these elements:
* ``otf`` (OpenType format),
* ``ttf`` and ``ttc`` (TrueType format),
-* ``dfont`` (Macintosh 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
diff --git a/misc/luaotfload.conf.example b/misc/luaotfload.conf.example
index 2756d62..b0323af 100644
--- a/misc/luaotfload.conf.example
+++ b/misc/luaotfload.conf.example
@@ -3,7 +3,7 @@
[db]
compress = true
- formats = otf, ttf, ttc, dfont
+ formats = otf, ttf, ttc
max-fonts = 2.2517998136852e15
scan-local = false
skip-read = false
diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua
index b901824..8faf3d1 100644
--- a/src/luaotfload-configuration.lua
+++ b/src/luaotfload-configuration.lua
@@ -89,7 +89,7 @@ local config_paths = {
}
local valid_formats = tabletohash {
- "otf", "ttc", "ttf", "dfont", "afm", "pfb", "pfa",
+ "otf", "ttc", "ttf", "afm", --"pfb", "pfa",
}
local feature_presets = {
@@ -188,7 +188,7 @@ local permissible_color_callbacks = {
local default_config = {
db = {
- formats = "otf,ttf,ttc,dfont",
+ formats = "otf,ttf,ttc",
scan_local = false,
skip_read = false,
strip = true,
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index b06f3d5..135ab0e 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -207,9 +207,8 @@ local make_luanames = function (path)
end
local format_precedence = {
- "otf", "ttc", "ttf",
- "dfont", "afm", "pfb",
- "pfa",
+ "otf", "ttc", "ttf", "afm",
+ --- "pfb", "pfa",
}
local location_precedence = {
@@ -336,7 +335,7 @@ This is a sketch of the luaotfload db:
}
and metadata = {
created : string // creation time
- formats : string list; // { "otf", "ttf", "ttc", "dfont" }
+ formats : string list; // { "otf", "ttf", "ttc" }
local : bool; (* set if local fonts were added to the db *)
modified : string // modification time
statistics : TODO; // created when built with "--stats"
@@ -360,7 +359,7 @@ This is a sketch of the luaotfload db:
conflicts : { barename : int; basename : int }; // filename conflict with font at index; happens with subfonts
familyname : string; // sanitized name of the font family the font belongs to, usually from the names table
fontname : string; // sanitized name of the font
- format : string; // "otf" | "ttf" | "dfont" | "pfa" | "pfb" | "afm"
+ format : string; // "otf" | "ttf" | "afm"
fullname : string; // sanitized full name of the font including style modifiers
fullpath : string; // path to font in filesystem
index : int; // index in the mappings table
@@ -496,7 +495,6 @@ local lookup_fullpath
local save_lookups
local save_names
local set_font_filter
-local t1_fullinfo
local update_names
--- state of the database
@@ -1619,74 +1617,13 @@ ot_fullinfo = function (filename,
return res
end
---[[doc--
-
- Type1 font inspector. In comparison with OTF, PFB’s contain a good
- deal less name fields which makes it tricky in some parts to find a
- meaningful representation for the database.
-
- Good read: http://www.adobe.com/devnet/font/pdfs/5004.AFM_Spec.pdf
-
---doc]]--
-
---- string -> int -> bool -> string -> fontentry
-
-t1_fullinfo = function (filename, _subfont, location, basename, format)
- local sanitized
- local metadata = load_font_file (filename)
- local fontname = metadata.fontname
- local fullname = metadata.fullname
- local familyname = metadata.familyname
- local italicangle = metadata.italicangle
- local style = ""
- local weight
-
- sanitized = sanitize_fontnames ({
- fontname = fontname,
- psname = fullname,
- metafamily = familyname,
- familyname = familyname,
- weight = metadata.weight, --- string identifier
- prefmodifiers = style,
- })
-
- weight = sanitized.weight
-
- if weight == "bold" then
- style = weight
- end
-
- if italicangle ~= 0 then
- style = style .. "italic"
- end
-
- return {
- basename = basename,
- fullpath = filename,
- subfont = false,
- location = location or "system",
- format = format,
- fullname = sanitized.fullname,
- fontname = sanitized.fontname,
- familyname = sanitized.familyname,
- plainname = fullname,
- psname = sanitized.fontname,
- version = metadata.version,
- size = false,
- fontstyle_name = style ~= "" and style or weight,
- weight = metadata.pfminfo and pfminfo.weight or 400,
- italicangle = italicangle,
- }
-end
-
local loaders = {
- dfont = ot_fullinfo,
otf = ot_fullinfo,
ttc = ot_fullinfo,
ttf = ot_fullinfo,
- pfb = t1_fullinfo,
- pfa = t1_fullinfo,
+----pfb = t1_fullinfo, --> may come back one day, so
+----pfa = t1_fullinfo, --> we keep the indirection
}
--- not side-effect free!
diff --git a/src/luaotfload-loaders.lua b/src/luaotfload-loaders.lua
index d3828aa..f0c1913 100644
--- a/src/luaotfload-loaders.lua
+++ b/src/luaotfload-loaders.lua
@@ -83,6 +83,7 @@ local install_formats = function ()
and aux ("pfa", unsupported_reader "pfa")
and aux ("pfb", unsupported_reader "pfb")
and aux ("ofm", readers.tfm)
+ and aux ("dfont", unsupported_reader "dfont")
end
--[[doc--
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua
index 92c1ff1..51a0657 100644
--- a/src/luaotfload-main.lua
+++ b/src/luaotfload-main.lua
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------
-- FILE: luaotfload-main.lua
-- DESCRIPTION: Luaotfload entry point
--- REQUIREMENTS: luatex v.0.80 or later; packages lualibs
+-- REQUIREMENTS: luatex v.0.95 or later; packages lualibs
-- AUTHOR: Élie Roux, Khaled Hosny, Philipp Gesang
-----------------------------------------------------------------------
--
@@ -29,8 +29,8 @@ local authors = "\z
luaotfload.module = {
name = "luaotfload-main",
- version = 2.70001,
- date = "2016/04/19",
+ version = 2.70002,
+ date = "2016/04/21",
description = "OpenType layout system.",
author = authors,
copyright = authors,
diff --git a/src/luaotfload.sty b/src/luaotfload.sty
index b6f03af..8e061c2 100644
--- a/src/luaotfload.sty
+++ b/src/luaotfload.sty
@@ -41,10 +41,10 @@
\ProvidesPackage{luaotfload}%
%% FIXME The date is meaningless, we need to find a way to
%% use the git revision instead.
- [2016/04/07 v2.7 OpenType layout system]
+ [2016/04/21 v2.7 OpenType layout system]
\fi
\directlua{
-require('luaotfload-main')
-local _void = luaotfload.main ()
+ require('luaotfload-main')
+ local _void = luaotfload.main ()
}