summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2013-05-27 01:27:54 +0000
committerNorbert Preining <preining@logic.at>2013-05-27 01:27:54 +0000
commit482b8f1300719b9a7e3cfecd1bcf745229f7a77c (patch)
tree9571c3e8ec3abbd175695095313c3a03cd766943 /Master/texmf-dist/tex/luatex
parent04a64779a0d27806141d9b0f6363b27807fba240 (diff)
luaotfload update 5/27
git-svn-id: svn://tug.org/texlive/trunk@30701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua2
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua6
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-nod.lua13
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua33
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-extralibs.lua6
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua13
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-database.lua4
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy.lua136
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua5
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua3
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua32
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua25
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty2
13 files changed, 212 insertions, 68 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua
index 2bfcbf0caf1..bb1e8f9048b 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua
@@ -75,7 +75,7 @@ local add_fontdata_fallbacks = function (fontdata)
fontdata.size = fontdata.size or fontparameters.size
local resources = fontdata.resources
--- for legacy fontspec.lua and unicode-math.lua
- fontdata.shared.otfdata = {
+ fontdata.shared.otfdata = {
pfminfo = { os2_capheight = metadata.pfminfo.os2_capheight },
metadata = { ascent = metadata.ascent },
}
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua
index 0561778b4cd..4a46fbb0782 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua
@@ -147,18 +147,18 @@ do
-- standard context tree setup
- local cachepaths = kpse.expand_path('$TEXMFCACHE') or ""
+ local cachepaths = kpse.expand_var('$TEXMFCACHE') or ""
-- quite like tex live or so
if cachepaths == "" then
- cachepaths = kpse.expand_path('$TEXMFVAR')
+ cachepaths = kpse.expand_var('$TEXMFVAR') or ""
end
-- this also happened to be used
if cachepaths == "" then
- cachepaths = kpse.expand_path('$VARTEXMF')
+ cachepaths = kpse.expand_var('$VARTEXMF') or ""
end
-- and this is a last resort
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-nod.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-nod.lua
index 151d98a8f31..5ab9df7f94b 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-nod.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-nod.lua
@@ -28,12 +28,12 @@ if tex.attribute[0] ~= 0 then
end
-attributes = { }
+attributes = attributes or { }
attributes.unsetvalue = -0x7FFFFFFF
local numbers, last = { }, 127
-function attributes.private(name)
+attributes.private = attributes.private or function(name)
local number = numbers[name]
if not number then
if last < 255 then
@@ -63,6 +63,9 @@ nodes.glyphcodes = glyphcodes
local free_node = node.free
local remove_node = node.remove
local new_node = node.new
+local traverse_id = node.traverse_id
+
+local math_code = nodecodes.math
nodes.handlers.protectglyphs = node.protect_glyphs
nodes.handlers.unprotectglyphs = node.unprotect_glyphs
@@ -93,3 +96,9 @@ function nodes.pool.kern(k)
n.kern = k
return n
end
+
+function nodes.endofmath(n)
+ for n in traverse_id(math_code,n.next) do
+ return n
+ end
+end
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua
index 0e4687493c6..60e321f1be2 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua
@@ -568,9 +568,11 @@ resolve = function (_,_,specification) -- the 1st two parameters are used by Con
subfamily = facenames.subfamily
fullname = facenames.fullname
psname = facenames.psname
+ fontname = facenames.fontname
+ pfullname = facenames.pfullname
end
- fontname = facenames.fontname or sanitize_string(face.fontname)
- pfullname = facenames.pfullname or sanitize_string(face.fullname)
+ fontname = fontname or sanitize_string(face.fontname)
+ pfullname = pfullname or sanitize_string(face.fullname)
local optsize, dsnsize, maxsize, minsize
if #face.size > 0 then
@@ -988,29 +990,14 @@ do
path_normalize = function (path)
path = stringgsub(path, '\\', '/')
path = stringlower(path)
- path = stringgsub(path, '^/cygdrive/(%a)/', '%1:/')
- path = filecollapsepath(path)
- return path
- end
-
- elseif os_name == "cygwin" then -- union of ms + unix
- path_normalize = function (path)
- path = stringgsub(path, '\\', '/')
- path = stringlower(path)
- path = stringgsub(path, '^/cygdrive/(%a)/', '%1:/')
- local dest = lfsreadlink(path)
- if dest then
- if kpsereadable_file(dest) then
- path = dest
- elseif kpsereadable_file(filejoin(filedirname(path), dest)) then
- path = filejoin(file.dirname(path), dest)
- else
- -- broken symlink?
- end
- end
path = filecollapsepath(path)
return path
end
+--[[doc--
+ Cygwin used to be treated different from windows and dos. This
+ special treatment was removed with a patch submitted by Ken Brown.
+ Reference: http://cygwin.com/ml/cygwin/2013-05/msg00006.html
+--doc]]--
else -- posix
path_normalize = function (path)
@@ -1377,7 +1364,7 @@ local function get_os_dirs()
"/System/Library/Fonts",
"/Network/Library/Fonts",
}
- elseif os.type == "windows" or os.type == "msdos" or os.name == "cygwin" then
+ elseif os.type == "windows" or os.type == "msdos" then
local windir = os.getenv("WINDIR")
return { filejoin(windir, 'Fonts') }
else
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-extralibs.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-extralibs.lua
index ddf36940a8d..84819f4f2f7 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-extralibs.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-extralibs.lua
@@ -51,12 +51,16 @@ local kernfont = typesetters.kernfont
nodes = nodes or { } --- should be present with luaotfload
local bothways = function (t) return table.swapped (t, t) end
-nodes.kerncodes = bothways({
+local kerncodes = bothways({
[0] = "fontkern",
[1] = "userkern",
[2] = "accentkern",
})
+kerncodes.kerning = kerncodes.fontkern --- idiosyncrasy
+
+nodes.kerncodes = kerncodes
+
nodes.skipcodes = bothways({
[ 0] = "userskip",
[ 1] = "lineskip",
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua
index 9713f95b3fd..a68eb049c10 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua
@@ -1015,18 +1015,17 @@ local field = field_char^1
--- switches are “+key” | “-key”
local normal_option = C(field) * ws * equals * ws * C(field) * ws
local xetex_option = P"+" * ws * normal_option
+local ignore_option = (1 - equals - featuresep)^1
+ * equals
+ * (1 - featuresep)^1
local assignment = xetex_option / handle_xetex_option
+ normal_option / handle_normal_option
------ assignment = (field / strip_leading_sign) * ws
------ * equals * ws
------ * (field / toboolean)
+ + ignore_option / handle_invalid_option
local switch = P"+" * ws * C(field) * Cc(true)
+ P"-" * ws * C(field) * Cc(false)
--- + C(field) * Cc(true) -- catch crap
-local ignore = (1 - featuresep)^1 --- ignores one option
- / handle_invalid_option
+ + C(field) * Cc(true) --- default
local feature_expr = ws * Cg(assignment + switch) * ws
-local option = feature_expr + ignore
+local option = feature_expr
local feature_list = Cf(Ct""
* option
* (featuresep * option)^0
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-database.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-database.lua
index 4af05f5486d..b31fe885264 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-database.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-database.lua
@@ -425,7 +425,7 @@ local function path_normalize(path)
- reading symlinks under non-Win32
- using kpse.readable_file on Win32
]]
- if os.type == "windows" or os.type == "msdos" or os.name == "cygwin" then
+ if os.type == "windows" or os.type == "msdos" then
path = path:gsub('\\', '/')
path = path:lower()
path = path:gsub('^/cygdrive/(%a)/', '%1:/')
@@ -635,7 +635,7 @@ local function get_os_dirs()
"/System/Library/Fonts",
"/Network/Library/Fonts",
}
- elseif os.type == "windows" or os.type == "msdos" or os.name == "cygwin" then
+ elseif os.type == "windows" or os.type == "msdos" then
local windir = os.getenv("WINDIR")
return { file.join(windir, 'Fonts') }
else
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy.lua
index e0c223033c1..8bb1790c667 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-legacy.lua
@@ -263,4 +263,140 @@ end
luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_diments, "unicodemath.set_sscale_diments")
+--[[doc--
+ Version 2.3c of fontspec dropped a couple features that are now
+ provided in the luaotfload auxiliary libraries. To avoid breaking
+ Mik\TEX (again), which is sorta the entire point of distributing the
+ legacy codebase, we temporarily restore those functions here.
+
+ Note that apart from cosmetic changes these are still the same as in
+ pre-TL2013 fontspec, relying on pairs() and other inefficient methods.
+--doc]]--
+
+luaotfload.aux = luaotfload.aux or { }
+local aux = luaotfload.aux
+
+local stringlower = string.lower
+local fontid = font.id
+
+local identifiers = fonts.identifiers
+
+local check_script = function (id, script)
+ local s = stringlower(script)
+ if id and id > 0 then
+ local tfmdata = identifiers[id]
+ local otfdata = tfmdata.shared and tfmdata.shared.otfdata
+ if otfdata then
+ local features = otfdata.luatex.features
+ for i, _ in pairs(features) do
+ for j, _ in pairs(features[i]) do
+ if features[i][j][s] then
+ fontspec.log("script '%s' exists in font '%s'",
+ script, tfmdata.fullname)
+ return true
+ end
+ end
+ end
+ end
+ end
+end
+
+local check_language = function (id, script, language)
+ local s = stringlower(script)
+ local l = stringlower(language)
+ if id and id > 0 then
+ local tfmdata = identifiers[id]
+ local otfdata = tfmdata.shared and tfmdata.shared.otfdata
+ if otfdata then
+ local features = otfdata.luatex.features
+ for i, _ in pairs(features) do
+ for j, _ in pairs(features[i]) do
+ if features[i][j][s] and features[i][j][s][l] then
+ fontspec.log("language '%s' for script '%s' exists in font '%s'",
+ language, script, tfmdata.fullname)
+ return true
+ end
+ end
+ end
+ end
+ end
+end
+
+local check_feature = function (id, script, language, feature)
+ local s = stringlower(script)
+ local l = stringlower(language)
+ local f = stringlower(feature:gsub("^[+-]", ""):gsub("=.*$", ""))
+ if id and id > 0 then
+ local tfmdata = identifiers[id]
+ local otfdata = tfmdata.shared and tfmdata.shared.otfdata
+ if otfdata then
+ local features = otfdata.luatex.features
+ for i, _ in pairs(features) do
+ if features[i][f] and features[i][f][s] then
+ if features[i][f][s][l] == true then
+ fontspec.log("feature '%s' for language '%s' and script '%s' exists in font '%s'",
+ feature, language, script, tfmdata.fullname)
+ return true
+ end
+ end
+ end
+ end
+ end
+end
+
+local get_math_dimension = function(fnt, str)
+ if type(fnt) == "string" then
+ fnt = fontid(fnt)
+ end
+ local tfmdata = identifiers[fnt]
+ if tfmdata then
+ local mathdata = tfmdata.MathConstants
+ if mathdata then
+ return mathdata[str]
+ end
+ end
+end
+
+aux.provides_script = check_script
+aux.provides_language = check_language
+aux.provides_feature = check_feature
+aux.get_math_dimension = get_math_dimension
+
+local set_capheight = function (tfmdata)
+ local capheight
+ local shared = tfmdata.shared
+ if shared then
+ local metadata = shared.otfdata.metadata
+ local units_per_em = metadata.units_per_em or tfmdata.units
+ local os2_capheight = shared.otfdata.pfminfo.os2_capheight
+ local size = tfmdata.size
+
+ if os2_capheight > 0 then
+ capheight = os2_capheight / units_per_em * size
+ else
+ local X8 = string.byte"X"
+ if tfmdata.characters[X8] then
+ capheight = tfmdata.characters[X8].height
+ else
+ capheight = metadata.ascent / units_per_em * size
+ end
+ end
+ else
+ local X8 = string.byte"X"
+ if tfmdata.characters[X8] then
+ capheight = tfmdata.characters[X8].height
+ end
+ end
+ if capheight then
+ tfmdata.parameters[8] = capheight
+ end
+end
+luatexbase.add_to_callback("luaotfload.patch_font",
+ set_capheight,
+ "luaotfload.set_capheight")
+
+--[[doc--
+End of auxiliary functionality that was moved from fontspec.lua.
+--doc]]--
+
-- vim:ts=2:sw=2:expandtab:ft=lua
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua
index 8566c06c963..87116462c8a 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua
@@ -90,7 +90,6 @@ kerncharacters = function (head)
local kernfactors = kernfactors
while start do
- local attr = start[attribute]
local id = start.id
if id == glyph_code then
@@ -163,7 +162,9 @@ kerncharacters = function (head)
-- nothing
elseif pid == kern_code then
- if prev.subtype == kerning_code or prev[a_fontkern] then
+ if prev.subtype == kerning_code --- context does this by means of an
+ or prev.subtype == userkern_code --- attribute; we may need a test
+ then
if keeptogether and prev.prev.id == glyph_code and keeptogether(prev.prev,start) then
-- keep
else
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
index c9c30de9082..b4ce0b285d0 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
@@ -6,7 +6,8 @@ if not modules then modules = { } end modules ["loaders"] = {
license = "see context related readme files"
}
-local fonts = fonts
+local fonts = fonts
+local readers = fonts.readers
---
--- opentype reader (from font-otf.lua):
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua
index 82ea91f77ec..5789db6c8cd 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 05/18/13 02:06:59
+-- merge date : 05/22/13 19:28:51
do -- begin closure to overcome local limits and interference
@@ -2017,11 +2017,21 @@ local pattern=(noslashes^0*slashes)^0*(noperiod^1*period)^1*C(noperiod^1)*-1
local function suffixonly(name)
return name and lpegmatch(pattern,name) or ""
end
+local pattern=(noslashes^0*slashes)^0*noperiod^1*((period*C(noperiod^1))^1)*-1+Cc("")
+local function suffixesonly(name)
+ if name then
+ return lpegmatch(pattern,name)
+ else
+ return ""
+ end
+end
file.pathpart=pathpart
file.basename=basename
file.nameonly=nameonly
file.suffixonly=suffixonly
file.suffix=suffixonly
+file.suffixesonly=suffixesonly
+file.suffixes=suffixesonly
file.dirname=pathpart
file.extname=suffixonly
local drive=C(R("az","AZ"))*colon
@@ -2300,16 +2310,10 @@ function file.strip(name,dir)
end
end
function lfs.mkdirs(path)
- local full
- for sub in gmatch(path,"([^\\/]+)") do
- if full then
- full=full.."/"..sub
- else
- full=sub
- end
- if not lfs.isdir(full) then
- lfs.mkdir(full)
- end
+ local full=""
+ for sub in gmatch(path,"(/*[^\\/]+)") do
+ full=full..sub
+ lfs.mkdir(full)
end
end
@@ -3007,12 +3011,12 @@ if not caches.namespace or caches.namespace=="" or caches.namespace=="context" t
caches.namespace='generic'
end
do
- local cachepaths=kpse.expand_path('$TEXMFCACHE') or ""
+ local cachepaths=kpse.expand_var('$TEXMFCACHE') or ""
if cachepaths=="" then
- cachepaths=kpse.expand_path('$TEXMFVAR')
+ cachepaths=kpse.expand_var('$TEXMFVAR') or ""
end
if cachepaths=="" then
- cachepaths=kpse.expand_path('$VARTEXMF')
+ cachepaths=kpse.expand_var('$VARTEXMF') or ""
end
if cachepaths=="" then
cachepaths="."
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
index f7f016d4755..95bb27fd949 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
@@ -37,23 +37,20 @@ config.luaotfload.color_callback = config.luaotfload.color_callback or "pre_l
luaotfload.module = {
name = "luaotfload",
version = 2.2,
- date = "2013/05/20",
+ date = "2013/05/23",
description = "OpenType layout system.",
author = "Elie Roux & Hans Hagen",
copyright = "Elie Roux",
license = "GPL v2.0"
}
-local luatexbase = luatexbase
+local luatexbase = luatexbase
-local type, next = type, next
local setmetatable = setmetatable
-local find_file = kpse.find_file
+local type, next = type, next
+
+local kpsefind_file = kpse.find_file
local lfsisfile = lfs.isfile
-local stringfind = string.find
-local stringformat = string.format
-local stringmatch = string.match
-local stringsub = string.sub
local add_to_callback, create_callback =
luatexbase.add_to_callback, luatexbase.create_callback
@@ -102,10 +99,10 @@ local p_suffix = (p_dot * (1 - p_dot - p_slash)^1 * P(-1)) / ""
local p_removesuffix = Cs((p_suffix + 1)^1)
local find_vf_file = function (name)
- local fullname = find_file(name, "ovf")
+ local fullname = kpsefind_file(name, "ovf")
if not fullname then
- --fullname = find_file(file.removesuffix(name), "ovf")
- fullname = find_file(lpegmatch(p_removesuffix, name), "ovf")
+ --fullname = kpsefind_file(file.removesuffix(name), "ovf")
+ fullname = kpsefind_file(lpegmatch(p_removesuffix, name), "ovf")
end
if fullname then
log("loading virtual font file %s.", fullname)
@@ -244,6 +241,12 @@ pop_namespaces(our_environment, false)-- true)
log("fontloader loaded in %0.3f seconds", os.gettimeofday()-starttime)
+if normal_expand_path ~= nil then
+ kpse.expand_path = normal_expand_path
+ phantom_kpse = nil
+end
+
+
callback.register = trapped_register
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
index df7a747db22..062b19085c0 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
@@ -29,7 +29,7 @@
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luaotfload}%
- [2013/05/20 v2.2c OpenType layout system]
+ [2013/05/23 v2.2d OpenType layout system]
\RequirePackage{luatexbase}
\fi
\ifnum\luatexversion<76