summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-21 21:47:53 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-21 21:47:53 +0200
commitf95f8775f18f0caf01bd0e2be163ca4ab0c1a127 (patch)
treebab3f67b73459e9a9526c1240d234a69b76bca58
parent3d9ffcf967635f7bd4c70ff8e41bc7603c461d42 (diff)
parent20e92df3bcad34b2951df17182cdb4c8ffef210a (diff)
downloadluaotfload-f95f8775f18f0caf01bd0e2be163ca4ab0c1a127.tar.gz
merge from eroux
-rw-r--r--Makefile7
-rw-r--r--NEWS17
-rw-r--r--luaotfload.dtx95
-rw-r--r--luaotfload.sty34
-rw-r--r--otfl-basics-gen.lua297
-rw-r--r--otfl-font-nms.lua45
-rw-r--r--otfl-fonts-merged.lua4
-rw-r--r--otfl-fonts.lua10
-rw-r--r--tests/color.tex6
-rw-r--r--tests/fontspec_lookup.ltx41
-rw-r--r--tests/fullname.tex6
-rw-r--r--tests/marks.tex3
-rw-r--r--tests/math.tex1
-rw-r--r--tests/microtypography.tex31
-rw-r--r--tests/opbd.tex30
-rw-r--r--tests/zero_width_marks_lig.tex16
16 files changed, 244 insertions, 399 deletions
diff --git a/Makefile b/Makefile
index 6606861..ae850ff 100644
--- a/Makefile
+++ b/Makefile
@@ -19,10 +19,9 @@ SOURCE = $(DTX) $(OTFL) README Makefile NEWS $(SCRIPT)
# test files
TESTDIR = tests
-TESTFILES = $(wildcard $(TESTDIR)/*.tex)
+TESTFILES = $(wildcard $(TESTDIR)/*.tex $(TESTDIR)/*.ltx)
TESTFILES_SYS = $(TESTDIR)/systemfonts.tex $(TESTDIR)/fontconfig_conf_reading.tex
TESTFILES_TL = $(filter-out $(TESTFILES_SYS), $(TESTFILES))
-TESTENV = env TEXINPUTS='.;..;$$TEXMF/tex/{luatex,plain,generic,}//' TEXMFVAR='../var'
# Files grouped by installation location
SCRIPTFILES = $(SCRIPT)
@@ -95,9 +94,9 @@ install: $(ALL_FILES)
check: $(RUNFILES) $(TESTFILES_TL)
@rm -rf var
- @cd $(TESTDIR); for f in $(TESTFILES_TL); do \
+ @for f in $(TESTFILES_TL); do \
echo "check: luatex $$f"; \
- $(TESTENV) luatex --interaction=batchmode ../$$f \
+ luatex --interaction=batchmode $$f \
> /dev/null || exit $$?; \
done
diff --git a/NEWS b/NEWS
index 42e6e14..754cbcd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,23 @@
Change History
--------------
+2013/04/xx, luaotfload v2.2:
+ * Synchronisation with ConTeXt from TeXLive 2013, inducing
+ backward-incompatible changes in the font structure (fontspec and
+ unicode-math must be updated)
+ * Synchronisation with ConTeXt is now easier and can be done by just
+ updating otfl-fonts-merged.lua (available in ConTeXt)
+ * Improve documentation
+ * renaming mkluatexfontdb into fontdbutil, with more search functionalities
+
+2013/04/11, luaotfload v1.28:
+ * Adapting to LuaTeX 0.75, keeping backward-compatibility
+ * Fix small documentation issues in mkluatexfontdb
+ * Fix possibility of infite loop with fontconfig config files references
+ * Adding semibold synonym for bold
+ * file:xxx syntax now uses the same search function as name: which
+ make more fonts recognized
+
2011/04/21, luaotfload v1.25:
* Fix bug loading *.dfont fonts
* Misc. documentation fixes
diff --git a/luaotfload.dtx b/luaotfload.dtx
index d59e18a..3685083 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -990,7 +990,7 @@ and the derived files
%<*lua>
% \fi
% \begin{macrocode}
-module("luaotfload", package.seeall)
+luaotfload = luaotfload or {}
luaotfload.module = {
name = "luaotfload",
@@ -1073,22 +1073,17 @@ end
local fl_prefix = "otfl" -- “luatex” for luatex-plain
local loadmodule = function (name)
- local tofind = fl_prefix .."-"..name
- local found = find_file(tofind,"tex")
- if found then
- log("loading file %s.", found)
- dofile(found)
- else
- error("file %s not found.", tofind)
- end
+ require(fl_prefix .."-"..name)
end
% \end{macrocode}
%
-% Virtual fonts are resolved via a callback.
-% \luafunction{find_vf_file} derives the name of the virtual font file
-% from the filename.
-% (NB: \CONTEXT handles this likewise in \fileent{font-vf.lua}.)
+% Before \TeX Live 2013 version, \LUATEX had a bug that made ofm fonts fail
+% when called with their extension. There was a side-effect making ofm
+% totally unloadable when luaotfload was present. The following lines are
+% a patch for this bug. The utility of these lines is questionable as they
+% are not necessary since \TeX Live 2013. They should be removed in the next
+% version.
%
% \begin{macrocode}
local Cs, P, lpegmatch = lpeg.Cs, lpeg.P, lpeg.match
@@ -1192,15 +1187,9 @@ end
% \identifier{luatexbase}-style callback handling here.
%
% \begin{macrocode}
-if not _G. generic_context then _G. generic_context = { } end
-if not _G.non_generic_context then _G.non_generic_context = { } end
-
-local generic_context = generic_context
-local non_generic_context =non_generic_context
+generic_context = {no_callbacks_yet = true}
-generic_context.no_callbacks_yet = true
-
-_G.non_generic_context = { luatex_fonts = {
+non_generic_context = { luatex_fonts = {
load_before = "otfl-fonts-merged.lua",
-- load_after = nil, --- TODO, this is meant for callbacks
skip_loading = true,
@@ -1220,6 +1209,23 @@ callback.register = dummy_function
% \end{macrocode}
%
+% In order to have an output with normal verbosity, we need to pre-override
+% some \CONTEXT log function:
+%
+% \begin{macrocode}
+
+local dummylogfunction=function() end
+local dummylogreporter=function(c) return function(...) log(string.formatters(...)) end end
+
+logs={
+ new=dummylogreporter,
+ reporter=dummylogreporter,
+ messenger=dummylogreporter,
+ report=dummylogfunction,
+}
+
+% \end{macrocode}
+%
% Now that things are sorted out we can finally load the fontloader.
%
% \begin{macrocode}
@@ -1247,9 +1253,9 @@ do
local new_attribute = luatexbase.new_attribute
local the_attributes = luatexbase.attributes
- _G.attributes = _G.attributes or { }
+ attributes = attributes or { }
- _G.attributes.private = function (name)
+ attributes.private = function (name)
local attr = "otfl@" .. name
local number = the_attributes[attr]
if not number then
@@ -1295,22 +1301,19 @@ loadmodule"font-otc.lua" -- TODO check what we can drop from otfl-features
loadmodule"lib-dir.lua" -- required by font-nms
loadmodule"luat-ovr.lua"
-if fonts and fonts.readers.tfm then
- --------------------------------------------------------------------
- --- OFM; read this first
- --------------------------------------------------------------------
- --- I can’t quite make out whether this is still relevant
- --- as those ofm fonts always fail, even in the 2011 version
- --- (mktexpk: don't know how to create bitmap font for omarabb.ofm)
- --- the font loader appears to read ofm like tfm so if this
- --- hack was supposed achieve that, we should excise it anyways
- fonts.readers.ofm = fonts.readers.tfm
- fonts.handlers.ofm = fonts.handlers.tfm --- empty anyways
- fonts.formats.ofm = fonts.formats.tfm --- “type1”
- --- fonts.readers.sequence[#fonts.readers.sequence+1] = "ofm"
- --------------------------------------------------------------------
-end
-
+% \end{macrocode}
+%
+%
+% \CONTEXT does not support ofm, these lines were added in order to make it
+% work. However they do not seem necessary so they are commented for now.
+%
+% \begin{macrocode}
+-- if fonts and fonts.readers.tfm then
+-- fonts.readers.ofm = fonts.readers.tfm
+-- fonts.handlers.ofm = fonts.handlers.tfm --- empty anyways
+-- fonts.formats.ofm = fonts.formats.tfm --- “type1”
+-- --- fonts.readers.sequence[#fonts.readers.sequence+1] = "ofm"
+--end
% \end{macrocode}
%
%
@@ -1325,6 +1328,20 @@ loadmodule"font-ltx.lua" --- new in 2.0, added 2011
% \end{macrocode}
%
%
+% This hack makes fonts called with file method found by fonts.names.resove
+% instead of just trying to find them with kpse. It is necessary in case
+% of fonts that are not accessible by kpse but present in the database, a
+% quite common case under Linux.
+%
+% \begin{macrocode}
+
+fonts.definers.resolvers.file = function (specification)
+ specification.name = fonts.names.resolve('', '', specification)
+end
+
+% \end{macrocode}
+%
+%
% We create a callback for patching fonts on the fly, to be used by other
% packages.
% It initially contains the empty function that we are going to override
diff --git a/luaotfload.sty b/luaotfload.sty
deleted file mode 100644
index 4d566af..0000000
--- a/luaotfload.sty
+++ /dev/null
@@ -1,34 +0,0 @@
-%%
-%% This is file `luaotfload.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luaotfload.dtx (with options: `package')
-%% This is a generated file.
-%%
-%% Copyright (C) 2009-2011 by by Elie Roux <elie.roux@telecom-bretagne.eu>
-%% and Khaled Hosny <khaledhosny@eglug.org>
-%% (Support: <lualatex-dev@tug.org>.)
-%%
-%% This work is under the CC0 license.
-%%
-%% This work consists of the main source file luaotfload.dtx
-%% and the derived files
-%% luaotfload.sty, luaotfload.lua
-%%
-\csname ifluaotfloadloaded\endcsname
-\let\ifluaotfloadloaded\endinput
-\bgroup\expandafter\expandafter\expandafter\egroup
-\expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \input luatexbase.sty
-\else
- \NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luaotfload}%
- [2011/10/06 v2.0 OpenType layout system]
- \RequirePackage{luatexbase}
-\fi
-\RequireLuaModule{luaotfload}
-\endinput
-%%
-%% End of file `luaotfload.sty'.
diff --git a/otfl-basics-gen.lua b/otfl-basics-gen.lua
deleted file mode 100644
index 288cfa2..0000000
--- a/otfl-basics-gen.lua
+++ /dev/null
@@ -1,297 +0,0 @@
-if not modules then modules = { } end modules ['luat-basics-gen'] = {
- version = 1.100,
- comment = "companion to luatex-*.tex",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-if context then
- texio.write_nl("fatal error: this module is not for context")
- os.exit()
-end
-
-local dummyfunction = function() end
------ dummyreporter = function(c) return function(...) texio.write_nl(c .. " : " .. string.format(...)) end end
-local dummyreporter = function(c) return function(...) texio.write_nl(c .. " : " .. string.formatters(...)) end end
-
-statistics = {
- register = dummyfunction,
- starttiming = dummyfunction,
- stoptiming = dummyfunction,
- elapsedtime = nil,
-}
-
-directives = {
- register = dummyfunction,
- enable = dummyfunction,
- disable = dummyfunction,
-}
-
-trackers = {
- register = dummyfunction,
- enable = dummyfunction,
- disable = dummyfunction,
-}
-
-experiments = {
- register = dummyfunction,
- enable = dummyfunction,
- disable = dummyfunction,
-}
-
-storage = { -- probably no longer needed
- register = dummyfunction,
- shared = { },
-}
-
-logs = {
- new = dummyreporter,
- reporter = dummyreporter,
- messenger = dummyreporter,
- report = dummyfunction,
-}
-
-callbacks = {
- register = function(n,f) return callback.register(n,f) end,
-
-}
-
-utilities = {
- storage = {
- allocate = function(t) return t or { } end,
- mark = function(t) return t or { } end,
- },
-}
-
-characters = characters or {
- data = { }
-}
-
--- we need to cheat a bit here
-
-texconfig.kpse_init = true
-
-resolvers = resolvers or { } -- no fancy file helpers used
-
-local remapper = {
- otf = "opentype fonts",
- ttf = "truetype fonts",
- ttc = "truetype fonts",
- dfont = "truetype fonts", -- "truetype dictionary",
- cid = "cid maps",
- cidmap = "cid maps",
- fea = "font feature files",
- pfa = "type1 fonts", -- this is for Khaled, in ConTeXt we don't use this!
- pfb = "type1 fonts", -- this is for Khaled, in ConTeXt we don't use this!
-}
-
-function resolvers.findfile(name,fileformat)
- name = string.gsub(name,"\\","/")
- if not fileformat or fileformat == "" then
- fileformat = file.suffix(name)
- if fileformat == "" then
- fileformat = "tex"
- end
- end
- fileformat = string.lower(fileformat)
- fileformat = remapper[fileformat] or fileformat
- local found = kpse.find_file(name,fileformat)
- if not found or found == "" then
- found = kpse.find_file(name,"other text files")
- end
- return found
-end
-
--- function resolvers.findbinfile(name,fileformat)
--- if not fileformat or fileformat == "" then
--- fileformat = file.suffix(name)
--- end
--- return resolvers.findfile(name,(fileformat and remapper[fileformat]) or fileformat)
--- end
-
-resolvers.findbinfile = resolvers.findfile
-
-function resolvers.resolve(s)
- return s
-end
-
-function resolvers.unresolve(s)
- return s
-end
-
--- Caches ... I will make a real stupid version some day when I'm in the
--- mood. After all, the generic code does not need the more advanced
--- ConTeXt features. Cached data is not shared between ConTeXt and other
--- usage as I don't want any dependency at all. Also, ConTeXt might have
--- different needs and tricks added.
-
---~ containers.usecache = true
-
-caches = { }
-
-local writable, readables = nil, { }
-
-if not caches.namespace or caches.namespace == "" or caches.namespace == "context" then
- caches.namespace = 'generic'
-end
-
-do
-
- local cachepaths = kpse.expand_path('$TEXMFCACHE') or ""
-
- if cachepaths == "" then
- cachepaths = kpse.expand_path('$TEXMFVAR')
- end
-
- if cachepaths == "" then
- cachepaths = kpse.expand_path('$VARTEXMF')
- end
-
- if cachepaths == "" then
- cachepaths = "."
- end
-
- cachepaths = string.split(cachepaths,os.type == "windows" and ";" or ":")
-
- for i=1,#cachepaths do
- if file.is_writable(cachepaths[i]) then
- writable = file.join(cachepaths[i],"luatex-cache")
- lfs.mkdir(writable)
- writable = file.join(writable,caches.namespace)
- lfs.mkdir(writable)
- break
- end
- end
-
- for i=1,#cachepaths do
- if file.is_readable(cachepaths[i]) then
- readables[#readables+1] = file.join(cachepaths[i],"luatex-cache",caches.namespace)
- end
- end
-
- if not writable then
- texio.write_nl("quiting: fix your writable cache path")
- os.exit()
- elseif #readables == 0 then
- texio.write_nl("quiting: fix your readable cache path")
- os.exit()
- elseif #readables == 1 and readables[1] == writable then
- texio.write(string.format("(using cache: %s)",writable))
- else
- texio.write(string.format("(using write cache: %s)",writable))
- texio.write(string.format("(using read cache: %s)",table.concat(readables, " ")))
- end
-
-end
-
-function caches.getwritablepath(category,subcategory)
- local path = file.join(writable,category)
- lfs.mkdir(path)
- path = file.join(path,subcategory)
- lfs.mkdir(path)
- return path
-end
-
-function caches.getreadablepaths(category,subcategory)
- local t = { }
- for i=1,#readables do
- t[i] = file.join(readables[i],category,subcategory)
- end
- return t
-end
-
-local function makefullname(path,name)
- if path and path ~= "" then
- name = "temp-" .. name -- clash prevention
- return file.addsuffix(file.join(path,name),"lua"), file.addsuffix(file.join(path,name),"luc")
- end
-end
-
-function caches.is_writable(path,name)
- local fullname = makefullname(path,name)
- return fullname and file.is_writable(fullname)
-end
-
-function caches.loaddata(paths,name)
- for i=1,#paths do
- local data = false
- local luaname, lucname = makefullname(paths[i],name)
- if lucname and lfs.isfile(lucname) then -- maybe also check for size
- texio.write(string.format("(load luc: %s)",lucname))
- data = loadfile(lucname)
- if data then
- data = data()
- end
- if data then
- return data
- else
- texio.write(string.format("(loading failed: %s)",lucname))
- end
- end
- if luaname and lfs.isfile(luaname) then
- texio.write(string.format("(load lua: %s)",luaname))
- data = loadfile(luaname)
- if data then
- data = data()
- end
- if data then
- return data
- end
- end
- end
-end
-
-function caches.savedata(path,name,data)
- local luaname, lucname = makefullname(path,name)
- if luaname then
- texio.write(string.format("(save: %s)",luaname))
- table.tofile(luaname,data,true,{ reduce = true })
- if lucname and type(caches.compile) == "function" then
- os.remove(lucname) -- better be safe
- texio.write(string.format("(save: %s)",lucname))
- caches.compile(data,luaname,lucname)
- end
- end
-end
-
--- According to KH os.execute is not permitted in plain/latex so there is
--- no reason to use the normal context way. So the method here is slightly
--- different from the one we have in context. We also use different suffixes
--- as we don't want any clashes (sharing cache files is not that handy as
--- context moves on faster.)
---
--- Beware: serialization might fail on large files (so maybe we should pcall
--- this) in which case one should limit the method to luac and enable support
--- for execution.
-
-caches.compilemethod = "both"
-
-function caches.compile(data,luaname,lucname)
- local done = false
- if caches.compilemethod == "luac" or caches.compilemethod == "both" then
- done = os.spawn("texluac -o " .. string.quoted(lucname) .. " -s " .. string.quoted(luaname)) == 0
- end
- if not done and (caches.compilemethod == "dump" or caches.compilemethod == "both") then
- local d = io.loaddata(luaname)
- if not d or d == "" then
- d = table.serialize(data,true) -- slow
- end
- if d and d ~= "" then
- local f = io.open(lucname,'w')
- if f then
- local s = loadstring(d)
- if s then
- f:write(string.dump(s,true))
- end
- f:close()
- end
- end
- end
-end
-
---
-
-function table.setmetatableindex(t,f)
- setmetatable(t,{ __index = f })
-end
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 048a90a..cec2a54 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -6,6 +6,11 @@ if not modules then modules = { } end modules ['font-nms'] = {
license = "GNU GPL v2"
}
+--- TODO: if the specification is an absolute filename with a font not in the
+--- database, add the font to the database and load it. There is a small
+--- difficulty with the filenames of the TEXMF tree that are referenced as
+--- relative paths...
+
--- Luatex builtins
local load = load
local next = next
@@ -57,14 +62,25 @@ fonts = fonts or { }
fonts.names = fonts.names or { }
local names = fonts.names
-local names_dir = "luatex-cache/generic/names"
+
names.version = 2.2
names.data = nil
names.path = {
basename = "otfl-names.lua",
- dir = filejoin(kpseexpand_var("$TEXMFVAR"), names_dir),
+ dir = "",
+ path = "",
}
+-- We use the cache.* of ConTeXt (see luat-basics-gen), we can
+-- use it safely (all checks and directory creations are already done). It
+-- uses TEXMFCACHE or TEXMFVAR as starting points.
+local writable_path = caches.getwritablepath("names","")
+if not writable_path then
+ error("Impossible to find a suitable writeable cache...")
+end
+names.path.dir = writable_path
+names.path.path = filejoin(writable_path, names.path.basename)
+
---- <FIXME>
---
@@ -165,8 +181,7 @@ local scan_external_dir
local update_names
load_names = function ( )
- local path = filejoin(names.path.dir, names.path.basename)
- local foundname, data = load_lua_file(path)
+ local foundname, data = load_lua_file(names.path.path)
if data then
report("info", 1, "db",
@@ -240,13 +255,14 @@ font database created by the mkluatexfontdb script.
---
--- the return value of “resolve” is the file name of the requested
--- font
-
+---
--- 'a -> 'a -> table -> (string * string | bool * bool)
---
--- note by phg: I added a third return value that indicates a
--- successful lookup as this cannot be inferred from the other
--- values.
---
+---
resolve = function (_,_,specification) -- the 1st two parameters are used by ConTeXt
local name = sanitize_string(specification.name)
local style = sanitize_string(specification.style) or "regular"
@@ -383,12 +399,12 @@ resolve = function (_,_,specification) -- the 1st two parameters are used by Con
return reload_db(resolve, nil, nil, specification)
else
--- else, fallback to requested name
- --- XXX: specification.name is empty with absolute paths, looks
- --- like a bug in the specification parser
+ --- specification.name is empty with absolute paths, looks
+ --- like a bug in the specification parser <TODO< is it still
+ --- relevant? looks not...
return specification.name, false, false
end
end
-
else --- no db or outdated; reload names and retry
if not fonts_reloaded then
return reload_db(resolve, nil, nil, specification)
@@ -895,7 +911,9 @@ read_fonts_conf = function (path, results, passed_paths)
read_fonts_conf(include, results, passed_paths)
elseif lfs.isdir(include) then
for _,f in next, dirglob(filejoin(include, "*.conf")) do
- read_fonts_conf(f, results, passed_paths)
+ if not passed_paths_set[f] then
+ read_fonts_conf(f, results, passed_paths)
+ end
end
end
end
@@ -921,12 +939,17 @@ local function get_os_dirs()
elseif os.type == "windows" or os.type == "msdos" or os.name == "cygwin" then
local windir = os.getenv("WINDIR")
return { filejoin(windir, 'Fonts') }
- else --- TODO what about ~/config/fontconfig/fonts.conf etc?
+ else
+ local passed_paths = {}
+ local os_dirs = {}
+ -- what about ~/config/fontconfig/fonts.conf etc?
+ -- Answer: they should be included by the others, please report if it's not
for _,p in next, {"/usr/local/etc/fonts/fonts.conf", "/etc/fonts/fonts.conf"} do
if lfs.isfile(p) then
- return read_fonts_conf("/etc/fonts/fonts.conf", {}, {})
+ read_fonts_conf(p, os_dirs, passed_paths)
end
end
+ return os_dirs
end
return {}
end
diff --git a/otfl-fonts-merged.lua b/otfl-fonts-merged.lua
index 44f42ed..e095153 100644
--- a/otfl-fonts-merged.lua
+++ b/otfl-fonts-merged.lua
@@ -2926,7 +2926,7 @@ storage={
register=dummyfunction,
shared={},
}
-logs={
+logs=logs or {
new=dummyreporter,
reporter=dummyreporter,
messenger=dummyreporter,
@@ -2988,7 +2988,7 @@ end
do
local cachepaths=kpse.expand_path('$TEXMFCACHE') or ""
if cachepaths=="" then
- cachepaths=kpse.expand_path('$TEXMFVAR')
+ cachepaths=kpse.expand_path('$TEXMFVAR') or ""
end
if cachepaths=="" then
cachepaths=kpse.expand_path('$VARTEXMF')
diff --git a/otfl-fonts.lua b/otfl-fonts.lua
index 75bd079..7e32465 100644
--- a/otfl-fonts.lua
+++ b/otfl-fonts.lua
@@ -37,10 +37,12 @@ if not generic_context then
generic_context = { }
end
+local printinfo = function(s) texio.write_nl("log", s) end
+
if not generic_context.push_namespaces then
function generic_context.push_namespaces()
- texio.write(" <push namespace>")
+ printinfo(" <push namespace>")
local normalglobal = { }
for k, v in next, _G do
normalglobal[k] = v
@@ -50,7 +52,7 @@ if not generic_context.push_namespaces then
function generic_context.pop_namespaces(normalglobal,isolate)
if normalglobal then
- texio.write(" <pop namespace>")
+ printinfo(" <pop namespace>")
for k, v in next, _G do
if not normalglobal[k] then
generic_context[k] = v
@@ -110,7 +112,7 @@ local function loadmodule(name,continue)
end
else
if verbose then
- texio.write(string.format(" <%s>",foundname)) -- no file.basename yet
+ printinfo(string.format(" <%s>",foundname)) -- no file.basename yet
end
dofile(foundname)
end
@@ -252,6 +254,6 @@ end
-- We're done.
-texio.write(string.format(" <luatex-fonts.lua loaded in %0.3f seconds>", os.gettimeofday()-starttime))
+--texio.write(string.format(" <luatex-fonts.lua loaded in %0.3f seconds>", os.gettimeofday()-starttime))
generic_context.pop_namespaces(whatever)
diff --git a/tests/color.tex b/tests/color.tex
index 1be8896..188889c 100644
--- a/tests/color.tex
+++ b/tests/color.tex
@@ -4,7 +4,7 @@
\font\testb=file:lmroman10-regular.otf:color=FFFF0099;+trep at 10pt
\font\testc=file:lmroman10-regular.otf:color=559922;+trep at 12pt
-\testa \input knuth \par
-\testb \input knuth \par
-\testc \input knuth \par
+\testa FF0000BB \par
+\testb FFFF0099 \par
+\testc 559922 \par
\bye
diff --git a/tests/fontspec_lookup.ltx b/tests/fontspec_lookup.ltx
new file mode 100644
index 0000000..6645427
--- /dev/null
+++ b/tests/fontspec_lookup.ltx
@@ -0,0 +1,41 @@
+\documentclass[a5paper,12pt]{scrartcl}
+\usepackage{fontspec}
+%% --------------------------------------------------------------------
+%% weirdness ahead
+%% --------------------------------------------------------------------
+\setmainfont
+ [Numbers=Lining,
+ BoldFont={TeX Gyre Pagella Bold},
+ BoldItalicFont={TeX Gyre Termes BoldItalic}]
+ {EB Garamond}
+%% --------------------------------------------------------------------
+
+%% --------------------------------------------------------------------
+%% excerpt from samples/knuth.tex
+%% --------------------------------------------------------------------
+\def\knuth{%
+ Thus, I came to the conclusion that the designer of a new
+ system must not only be the implementer and first
+ large--scale user; the designer should also write the first
+ user manual.
+
+ The separation of any of these four components would have
+ hurt \TeX\ significantly. If I had not participated fully in
+ all these activities, literally hundreds of improvements
+ would never have been made, because I would never have
+ thought of them or perceived why they were important.
+
+}
+
+%% --------------------------------------------------------------------
+%% main
+%% --------------------------------------------------------------------
+\begin{document}
+
+ \section{regular} {\rmfamily\upshape\knuth}
+ \section{bold face} {\rmfamily\bfseries\knuth}
+ \section{italic} {\rmfamily\itshape\knuth}
+ \section{slanted} {\rmfamily\slshape\knuth}
+ \section{bold italic} {\rmfamily\bfseries\itshape\knuth}
+
+\end{document}
diff --git a/tests/fullname.tex b/tests/fullname.tex
index 0209c98..78cf4d0 100644
--- a/tests/fullname.tex
+++ b/tests/fullname.tex
@@ -3,7 +3,13 @@
\font\testa={LM Roman Slanted 10 Regular} at 10pt
\font\testb={LM Roman 9 Italic} at 10pt
\font\testc={TeX Gyre Termes Bold} at 25pt
+% Also testing with absolute filename, please change the path according to your
+% system
+\font\testd=file:/usr/share/texmf/fonts/opentype/public/lm/lmmono10-italic.otf
+
\testa abcd ABCD\par
\testb abcd ABCD\par
\testc abcd ABCD\par
+\testd abcd ABCD\par
+
\bye
diff --git a/tests/marks.tex b/tests/marks.tex
index d33c82a..3af264e 100644
--- a/tests/marks.tex
+++ b/tests/marks.tex
@@ -1,6 +1,9 @@
\input luaotfload.sty
\font\test={file:GenBasR.ttf:script=latn}
+\test ä\quad Ä
+
\test a\char"0308
\quad A\char"0308
\quad j\char"0323
+
\bye
diff --git a/tests/math.tex b/tests/math.tex
index 55bb2aa..a2615f1 100644
--- a/tests/math.tex
+++ b/tests/math.tex
@@ -35,7 +35,6 @@ $$
$$
\Umathaccent "0 "4 "23DE {a+b}
-+ \Umathbotaccent "0 "4 "23DF {a+b} = C
$$
$$
diff --git a/tests/microtypography.tex b/tests/microtypography.tex
index 7d032e3..99deb5f 100644
--- a/tests/microtypography.tex
+++ b/tests/microtypography.tex
@@ -4,6 +4,33 @@
\font\testa=file:texgyretermes-regular:script=latn at 12pt
\font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt
-\testa \input tufte \par
-\testb \input tufte \par
+
+\testa We thrive in information thick worlds because of our
+marvelous and everyday capacity to select, edit,
+single out, structure, highlight, group, pair, merge,
+harmonize, synthesize, focus, organize, condense,
+reduce, boil down, choose, categorize, catalog, classify,
+list, abstract, scan, look into, idealize, isolate,
+discriminate, distinguish, screen, pigeonhole, pick over,
+sort, integrate, blend, inspect, filter, lump, skip,
+smooth, chunk, average, approximate, cluster, aggregate,
+outline, summarize, itemize, review, dip into,
+flip through, browse, glance into, leaf through, skim,
+refine, enumerate, glean, synopsize, winnow the wheat
+from the chaff and separate the sheep from the goats.\par
+
+\testb We thrive in information thick worlds because of our
+marvelous and everyday capacity to select, edit,
+single out, structure, highlight, group, pair, merge,
+harmonize, synthesize, focus, organize, condense,
+reduce, boil down, choose, categorize, catalog, classify,
+list, abstract, scan, look into, idealize, isolate,
+discriminate, distinguish, screen, pigeonhole, pick over,
+sort, integrate, blend, inspect, filter, lump, skip,
+smooth, chunk, average, approximate, cluster, aggregate,
+outline, summarize, itemize, review, dip into,
+flip through, browse, glance into, leaf through, skim,
+refine, enumerate, glean, synopsize, winnow the wheat
+from the chaff and separate the sheep from the goats.\par
+
\bye
diff --git a/tests/opbd.tex b/tests/opbd.tex
index 50c4dfd..1a838cd 100644
--- a/tests/opbd.tex
+++ b/tests/opbd.tex
@@ -4,6 +4,32 @@
\font\testa=file:texgyrepagella-regular:script=latn at 12pt
\font\testb=file:texgyrepagella-regular:mode=node;script=latn;protrusion=yes;featurefile=opbd.fea;+opbd at 12pt
-\testa \input tufte \par
-\testb \input tufte \par
+
+\testa We thrive in information thick worlds because of our
+marvelous and everyday capacity to select, edit,
+single out, structure, highlight, group, pair, merge,
+harmonize, synthesize, focus, organize, condense,
+reduce, boil down, choose, categorize, catalog, classify,
+list, abstract, scan, look into, idealize, isolate,
+discriminate, distinguish, screen, pigeonhole, pick over,
+sort, integrate, blend, inspect, filter, lump, skip,
+smooth, chunk, average, approximate, cluster, aggregate,
+outline, summarize, itemize, review, dip into,
+flip through, browse, glance into, leaf through, skim,
+refine, enumerate, glean, synopsize, winnow the wheat
+from the chaff and separate the sheep from the goats.\par
+
+\testb We thrive in information thick worlds because of our
+marvelous and everyday capacity to select, edit,
+single out, structure, highlight, group, pair, merge,
+harmonize, synthesize, focus, organize, condense,
+reduce, boil down, choose, categorize, catalog, classify,
+list, abstract, scan, look into, idealize, isolate,
+discriminate, distinguish, screen, pigeonhole, pick over,
+sort, integrate, blend, inspect, filter, lump, skip,
+smooth, chunk, average, approximate, cluster, aggregate,
+outline, summarize, itemize, review, dip into,
+flip through, browse, glance into, leaf through, skim,
+refine, enumerate, glean, synopsize, winnow the wheat
+from the chaff and separate the sheep from the goats.\par
\bye
diff --git a/tests/zero_width_marks_lig.tex b/tests/zero_width_marks_lig.tex
new file mode 100644
index 0000000..2c6dba9
--- /dev/null
+++ b/tests/zero_width_marks_lig.tex
@@ -0,0 +1,16 @@
+\input luaotfload.sty
+
+% https://bugs.freedesktop.org/attachment.cgi?id=72363
+\font\testa=file:TestLig.ttf:script=tibt;+ccmp+abvs+blws+kern at 10pt
+
+\testa གཚོའི་ཁིའུ་ཨཱཿཀ
+
+% good result for the first part:
+% https://bugs.freedesktop.org/attachment.cgi?id=72365
+% for the second part, the two circles shoud appear clearlybefore the last
+% letter, not mixed with it
+
+% see http://lists.freedesktop.org/archives/harfbuzz/2013-April/003101.html
+% for some technical details.
+
+\bye