From e1353b47437cbc7c93c601670ce39cc2bfede42d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 18 Nov 2010 00:35:21 +0000 Subject: luaotfload (17nov10) git-svn-id: svn://tug.org/texlive/trunk@20475 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/luatex/luaotfload/NEWS | 3 + .../doc/luatex/luaotfload/luaotfload.pdf | Bin 184688 -> 184618 bytes .../source/luatex/luaotfload/luaotfload.dtx | 88 +++++++-------------- .../tex/luatex/luaotfload/luaotfload.lua | 57 +++---------- .../tex/luatex/luaotfload/luaotfload.sty | 13 ++- 5 files changed, 49 insertions(+), 112 deletions(-) diff --git a/Master/texmf-dist/doc/luatex/luaotfload/NEWS b/Master/texmf-dist/doc/luatex/luaotfload/NEWS index 3ab467890b7..6fda94223c4 100644 --- a/Master/texmf-dist/doc/luatex/luaotfload/NEWS +++ b/Master/texmf-dist/doc/luatex/luaotfload/NEWS @@ -1,6 +1,9 @@ Change History -------------- +2010/11/11, luaotfload v1.21: + * Adapt to luatexbase v3.0 + 2010/10/16, luaotfload v1.20: * Make cache directory creation more robust * Fix GPOS mark placement in left-to-right direction diff --git a/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf b/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf index fea5cd24dcc..823f0e848b7 100644 Binary files a/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf and b/Master/texmf-dist/doc/luatex/luaotfload/luaotfload.pdf differ diff --git a/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx b/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx index 6c3dafd7667..30898f61087 100644 --- a/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx +++ b/Master/texmf-dist/source/luatex/luaotfload/luaotfload.dtx @@ -35,7 +35,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luaotfload 2010/10/16 v1.20 OpenType layout system} +\Msg{* Package: luaotfload 2010/11/11 v1.21 OpenType layout system} \Msg{************************************************************************} \keepsilent @@ -102,7 +102,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaotfload.drv}% - [2010/10/16 v1.20 OpenType layout system]% + [2010/11/11 v1.21 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor} \usepackage{charter} @@ -153,7 +153,7 @@ and the derived files % \GetFileInfo{luaotfload.drv} % % \title{The \textsf{luaotfload} package} -% \date{2010/10/16 v1.20} +% \date{2010/11/11 v1.21} % \author{ Elie Roux\footnote{\texttt{elie.roux@telecom-bretagne.eu}} % \and Khaled Hosny\footnote{\texttt{khaledhosny@eglug.org}}} % @@ -450,16 +450,15 @@ module('luaotfload', package.seeall) luaotfload.module = { name = "luaotfload", - version = 1.20, - date = "2010/10/16", + version = 1.21, + date = "2010/11/11", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", license = "CC0" } -luatexbase.provides_module(luaotfload.module) - +local error, warning, info, log = luatexbase.provides_module(luaotfload.module) % \end{macrocode} % % This is a necessary initalization in order not to rebuild an existing font. @@ -469,35 +468,12 @@ luatexbase.provides_module(luaotfload.module) % fine even if |\pdfpkresolution| is changed. % % \begin{macrocode} - kpse.init_prog('', 600, '/') - -% \end{macrocode} -% -% Some helper functions. -% -% \begin{macrocode} - -local format = string.format - -local function log(...) - luatexbase.module_log ('luaotfload', format(...)) -end - -local function error(...) - luatexbase.module_error ('luaotfload', format(...)) -end - -local function warning(...) - luatexbase.module_warning('luaotfload', format(...)) -end - % \end{macrocode} % % The minimal required \LuaTeX\ version. % % \begin{macrocode} - local luatex_version = 60 if tex.luatexversion < luatex_version then @@ -505,7 +481,6 @@ if tex.luatexversion < luatex_version then tex.luatexversion/100, luatex_version /100) end - % \end{macrocode} % % \subsection{Module loading} @@ -515,7 +490,6 @@ end % name. % % \begin{macrocode} - function luaotfload.loadmodule(name) local tofind = 'otfl-'..name local found = kpse.find_file(tofind,"tex") @@ -526,7 +500,6 @@ function luaotfload.loadmodule(name) error('file %s not found.', tofind) end end - % \end{macrocode} % % We start loading some lua files. These two are some code not used by @@ -534,30 +507,24 @@ end % low-level \ConTeXt\ functions. % % \begin{macrocode} - luaotfload.loadmodule('luat-dum.lua') -- not used in context at all luaotfload.loadmodule('luat-ovr.lua') -- override some luat-dum functions luaotfload.loadmodule('data-con.lua') -- maybe some day we don't need this one - % \end{macrocode} % % A hack to remove a warning from \texttt{node-dum.lua} as it is \ConTeXt\ % specific. % % \begin{macrocode} - tex.attribute[0] = 0 - % \end{macrocode} % % Node support modules. % % \begin{macrocode} - luaotfload.loadmodule('font-ini.lua') luaotfload.loadmodule('node-dum.lua') luaotfload.loadmodule('node-inj.lua') - % \end{macrocode} % % By default \ConTeXt\ takes some private attributes for internal use. To @@ -567,7 +534,6 @@ luaotfload.loadmodule('node-inj.lua') % avoid possiple name clashes. % % \begin{macrocode} - function attributes.private(name) local attr = 'otfl@' .. name local number = luatexbase.attributes[attr] @@ -576,13 +542,11 @@ function attributes.private(name) end return number end - % \end{macrocode} % % Font handling modules. % % \begin{macrocode} - luaotfload.loadmodule('font-tfm.lua') luaotfload.loadmodule('font-cid.lua') luaotfload.loadmodule('font-ott.lua') @@ -597,7 +561,6 @@ luaotfload.loadmodule('font-otc.lua') luaotfload.loadmodule('font-def.lua') luaotfload.loadmodule('font-xtx.lua') luaotfload.loadmodule('font-dum.lua') - % \end{macrocode} % % This is a patch for |otfl-font-def.lua|, that defines a reader for ofm @@ -606,20 +569,16 @@ luaotfload.loadmodule('font-dum.lua') % |mkluatexfontdb|. % % \begin{macrocode} - if fonts and fonts.tfm and fonts.tfm.readers then fonts.tfm.readers.ofm = fonts.tfm.readers.tfm end - % \end{macrocode} % % \textsf{luaotfload} specific modules. % % \begin{macrocode} - luaotfload.loadmodule('font-nms.lua') luaotfload.loadmodule('font-clr.lua') - % \end{macrocode} % % \subsection{Post-processing TFM table} @@ -678,6 +637,23 @@ local function def_font(...) mc["FractionDelimiterDisplayStyleSize"] = 2.39 * size fontdata.MathConstants = mc +% \end{macrocode} +% +% \LuaTeX\ does not provide interface to accessing +% \texttt{(Script)ScriptPercentScaleDown} math constants, so we emulate +% \XeTeX\ behaviour by setting \cs{fontdimen10} and \cs{fontdimen11}. +% +% \begin{macrocode} + if mc["ScriptPercentScaleDown"] then + 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"] + else -- resort to plain TeX default + fontdata.parameters[11] = 50 + end end end @@ -690,16 +666,13 @@ end % Here we override some defaults set in \ConTeXt\ code. % % \begin{macrocode} - fonts.mode = "node" - % \end{macrocode} % % The following features are useful in math (e.g. in XITS Math font), % but \textsf{luaotfload} does not recognize them in |base| mode. % % \begin{macrocode} - local register_base_sub = fonts.otf.features.register_base_substitution local gsubs = { "ss01", "ss02", "ss03", "ss04", "ss05", @@ -711,13 +684,11 @@ local gsubs = { for _,v in next, gsubs do register_base_sub(v) end - % \end{macrocode} % % Finally two functions % % \begin{macrocode} - function luaotfload.register_callbacks() luatexbase.add_to_callback('pre_linebreak_filter', nodes.simple_font_handler, @@ -764,27 +735,26 @@ end \bgroup\expandafter\expandafter\expandafter\egroup \expandafter\ifx\csname ProvidesPackage\endcsname\relax - \input luatextra.sty + \input luatexbase.sty \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2010/10/16 v1.20 OpenType layout system] - \RequirePackage{luatextra} + [2010/11/11 v1.21 OpenType layout system] + \RequirePackage{luatexbase} \fi +\RequireLuaModule{lualibs} \expandafter\edef\csname otfl@AtEnd\endcsname{% \catcode64 \the\catcode64\relax } \catcode64 11 - % \end{macrocode} % % Two small macros to register or unregister the callbacks. Without the % callbacks this package is totally turned off. % % \begin{macrocode} - \def\otfl@off{ \directlua{luaotfload.unregister_callbacks()} } @@ -792,14 +762,12 @@ end \def\otfl@on{ \directlua{luaotfload.register_callbacks()} } - % \end{macrocode} % % We load the |lua| file, and we turn the package on. % % \begin{macrocode} - -\luatexUseModule{luaotfload} +\RequireLuaModule{luaotfload} \otfl@on diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua index cc3e3ed50ad..b5e2325041a 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua @@ -20,35 +20,16 @@ module('luaotfload', package.seeall) luaotfload.module = { name = "luaotfload", - version = 1.20, - date = "2010/10/16", + version = 1.21, + date = "2010/11/11", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", license = "CC0" } -luatexbase.provides_module(luaotfload.module) - - +local error, warning, info, log = luatexbase.provides_module(luaotfload.module) kpse.init_prog('', 600, '/') - - -local format = string.format - -local function log(...) - luatexbase.module_log ('luaotfload', format(...)) -end - -local function error(...) - luatexbase.module_error ('luaotfload', format(...)) -end - -local function warning(...) - luatexbase.module_warning('luaotfload', format(...)) -end - - local luatex_version = 60 if tex.luatexversion < luatex_version then @@ -56,8 +37,6 @@ if tex.luatexversion < luatex_version then tex.luatexversion/100, luatex_version /100) end - - function luaotfload.loadmodule(name) local tofind = 'otfl-'..name local found = kpse.find_file(tofind,"tex") @@ -68,21 +47,13 @@ function luaotfload.loadmodule(name) error('file %s not found.', tofind) end end - - luaotfload.loadmodule('luat-dum.lua') -- not used in context at all luaotfload.loadmodule('luat-ovr.lua') -- override some luat-dum functions luaotfload.loadmodule('data-con.lua') -- maybe some day we don't need this one - - tex.attribute[0] = 0 - - luaotfload.loadmodule('font-ini.lua') luaotfload.loadmodule('node-dum.lua') luaotfload.loadmodule('node-inj.lua') - - function attributes.private(name) local attr = 'otfl@' .. name local number = luatexbase.attributes[attr] @@ -91,8 +62,6 @@ function attributes.private(name) end return number end - - luaotfload.loadmodule('font-tfm.lua') luaotfload.loadmodule('font-cid.lua') luaotfload.loadmodule('font-ott.lua') @@ -107,16 +76,11 @@ luaotfload.loadmodule('font-otc.lua') luaotfload.loadmodule('font-def.lua') luaotfload.loadmodule('font-xtx.lua') luaotfload.loadmodule('font-dum.lua') - - if fonts and fonts.tfm and fonts.tfm.readers then fonts.tfm.readers.ofm = fonts.tfm.readers.tfm end - - luaotfload.loadmodule('font-nms.lua') luaotfload.loadmodule('font-clr.lua') - local function def_font(...) local fontdata = fonts.define.read(...) if type(fontdata) == "table" and fontdata.shared then @@ -150,15 +114,22 @@ local function def_font(...) mc["FractionDelimiterDisplayStyleSize"] = 2.39 * size fontdata.MathConstants = mc + if mc["ScriptPercentScaleDown"] then + 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"] + else -- resort to plain TeX default + fontdata.parameters[11] = 50 + end end end return fontdata end - fonts.mode = "node" - - local register_base_sub = fonts.otf.features.register_base_substitution local gsubs = { "ss01", "ss02", "ss03", "ss04", "ss05", @@ -170,8 +141,6 @@ 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, diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty index 4814924f393..bbc3aab9f8b 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty @@ -21,21 +21,20 @@ \bgroup\expandafter\expandafter\expandafter\egroup \expandafter\ifx\csname ProvidesPackage\endcsname\relax - \input luatextra.sty + \input luatexbase.sty \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2010/10/16 v1.20 OpenType layout system] - \RequirePackage{luatextra} + [2010/11/11 v1.21 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()} } @@ -43,9 +42,7 @@ \def\otfl@on{ \directlua{luaotfload.register_callbacks()} } - - -\luatexUseModule{luaotfload} +\RequireLuaModule{luaotfload} \otfl@on -- cgit v1.2.3