summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-01-26 23:18:53 +0000
committerKarl Berry <karl@freefriends.org>2011-01-26 23:18:53 +0000
commit152d83d510920eb7284a5f3c7bf4ee9d4d30b947 (patch)
tree65224ab14af0e2b630451afab8bb1294b9f863e1 /Master/texmf-dist/tex/luatex/luaotfload
parent0d1a26d0ff0d103cfb7cd990a964a95db1b54292 (diff)
luaotfload 1.22 (26jan11)
git-svn-id: svn://tug.org/texlive/trunk@21180 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua55
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty21
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua24
3 files changed, 41 insertions, 59 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
index b5e2325041a..e8ddf3fd463 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
@@ -9,6 +9,7 @@
--
-- Copyright (C) 2009-2010 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.
--
@@ -20,8 +21,8 @@ module('luaotfload', package.seeall)
luaotfload.module = {
name = "luaotfload",
- version = 1.21,
- date = "2010/11/11",
+ version = 1.22,
+ date = "2011/01/25",
description = "OpenType layout system.",
author = "Elie Roux & Hans Hagen",
copyright = "Elie Roux",
@@ -81,6 +82,7 @@ if fonts and fonts.tfm and fonts.tfm.readers then
end
luaotfload.loadmodule('font-nms.lua')
luaotfload.loadmodule('font-clr.lua')
+luatexbase.create_callback("luaotfload.patch_font", "simple", function() end)
local function def_font(...)
local fontdata = fonts.define.read(...)
if type(fontdata) == "table" and fontdata.shared then
@@ -110,22 +112,22 @@ local function def_font(...)
end
end
-- for \overwithdelims
- mc["FractionDelimiterSize"] = 1.01 * size
- mc["FractionDelimiterDisplayStyleSize"] = 2.39 * size
+ mc.FractionDelimiterSize = 1.01 * size
+ mc.FractionDelimiterDisplayStyleSize = 2.39 * size
fontdata.MathConstants = mc
if mc["ScriptPercentScaleDown"] then
- fontdata.parameters[10] = mc["ScriptPercentScaleDown"]
+ fontdata.parameters[10] = mc.ScriptPercentScaleDown
else -- resort to plain TeX default
fontdata.parameters[10] = 70
end
if mc["ScriptScriptPercentScaleDown"] then
- fontdata.parameters[11] = mc["ScriptScriptPercentScaleDown"]
+ fontdata.parameters[11] = mc.ScriptScriptPercentScaleDown
else -- resort to plain TeX default
fontdata.parameters[11] = 50
end
end
-
+ luatexbase.call_callback("luaotfload.patch_font", fontdata)
end
return fontdata
end
@@ -141,31 +143,18 @@ local gsubs = {
for _,v in next, gsubs do
register_base_sub(v)
end
-function luaotfload.register_callbacks()
- luatexbase.add_to_callback('pre_linebreak_filter',
- nodes.simple_font_handler,
- 'luaotfload.pre_linebreak_filter')
- luatexbase.add_to_callback('hpack_filter',
- nodes.simple_font_handler,
- 'luaotfload.hpack_filter')
- luatexbase.reset_callback('define_font')
- luatexbase.add_to_callback('define_font',
- def_font,
- 'luaotfload.define_font', 1)
- luatexbase.add_to_callback('find_vf_file',
- fonts.vf.find,
- 'luaotfload.find_vf_file')
-end
-
-function luaotfload.unregister_callbacks()
- luatexbase.remove_from_callback('pre_linebreak_filter',
- 'luaotfload.pre_linebreak_filter')
- luatexbase.remove_from_callback('hpack_filter',
- 'luaotfload.hpack_filter')
- luatexbase.remove_from_callback('define_font',
- 'luaotfload.define_font')
- luatexbase.remove_from_callback('find_vf_file',
- 'luaotfload.find_vf_file')
-end
+luatexbase.add_to_callback('pre_linebreak_filter',
+ nodes.simple_font_handler,
+ 'luaotfload.pre_linebreak_filter')
+luatexbase.add_to_callback('hpack_filter',
+ nodes.simple_font_handler,
+ 'luaotfload.hpack_filter')
+luatexbase.reset_callback('define_font')
+luatexbase.add_to_callback('define_font',
+ def_font,
+ 'luaotfload.define_font', 1)
+luatexbase.add_to_callback('find_vf_file',
+ fonts.vf.find,
+ 'luaotfload.find_vf_file')
--
-- End of File `luaotfload.lua'.
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
index bbc3aab9f8b..0cb6ef5a31a 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
@@ -9,6 +9,7 @@
%%
%% Copyright (C) 2009-2010 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.
%%
@@ -25,28 +26,12 @@
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luaotfload}%
- [2010/11/11 v1.21 OpenType layout system]
+ [2011/01/25 v1.22 OpenType layout system]
\RequirePackage{luatexbase}
\fi
-\RequireLuaModule{lualibs}
-
-\expandafter\edef\csname otfl@AtEnd\endcsname{%
- \catcode64 \the\catcode64\relax
-}
-
-\catcode64 11
-\def\otfl@off{
-\directlua{luaotfload.unregister_callbacks()}
-}
-\def\otfl@on{
-\directlua{luaotfload.register_callbacks()}
-}
+\RequireLuaModule{lualibs}
\RequireLuaModule{luaotfload}
-
-\otfl@on
-
-\otfl@AtEnd
\endinput
%%
%% End of file `luaotfload.sty'.
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua
index 938b6bd39cb..b565aac0a80 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua
@@ -47,7 +47,7 @@ local function fontnames_init()
}
end
-function names.load()
+local function load_names()
local localpath = file.join(names.path.localdir, names.path.basename)
local systempath = file.join(names.path.systemdir, names.path.basename)
local kpsefound = kpse.find_file(names.path.basename)
@@ -238,7 +238,7 @@ end
local lastislog = 0
-function log(fmt, ...)
+local function log(fmt, ...)
lastislog = 1
texio.write_nl(format("luaotfload | %s", format(fmt,...)))
io.flush()
@@ -248,8 +248,6 @@ logs = logs or { }
logs.report = logs.report or log
logs.info = logs.info or log
-local log = names.log
-
local function font_fullinfo(filename, subfont, texmf)
local t = { }
local f = fontloader.open(filename, subfont)
@@ -635,9 +633,10 @@ local function update_names(fontnames, force)
if force then
fontnames = fontnames_init()
else
- if not fontnames
- or not fontnames.version
- or fontnames.version ~= names.version then
+ if not fontnames then
+ fontnames = names.load()
+ end
+ if fontnames.version ~= names.version then
fontnames = fontnames_init()
if trace_search then
logs.report("No font names database or old one found; "
@@ -659,7 +658,15 @@ local function save_names(fontnames)
if not lfs.isdir(savepath) then
dir.mkdirs(savepath)
end
- table.tofile(file.join(savepath, names.path.basename), fontnames, true)
+ savepath = file.join(savepath, names.path.basename)
+ if file.iswritable(savepath) then
+ table.tofile(savepath, fontnames, true)
+ logs.info("Font names database saved: %s \n", savepath)
+ return savepath
+ else
+ logs.info("Failed to save names database\n")
+ return nil
+ end
end
local function scan_external_dir(dir)
@@ -676,5 +683,6 @@ local function scan_external_dir(dir)
end
names.scan = scan_external_dir
+names.load = load_names
names.update = update_names
names.save = save_names