From db19f6314830be14197c947987532109fd7b56b1 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Thu, 11 Nov 2010 07:34:19 +0200 Subject: Prepare for release --- NEWS | 3 +++ luaotfload.dtx | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 3ab4678..6fda942 100644 --- a/NEWS +++ b/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/luaotfload.dtx b/luaotfload.dtx index 880bb59..30898f6 100644 --- a/luaotfload.dtx +++ b/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,8 +450,8 @@ 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", @@ -739,7 +739,7 @@ end \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2010/10/16 v1.20 OpenType layout system] + [2010/11/11 v1.21 OpenType layout system] \RequirePackage{luatexbase} \fi \RequireLuaModule{lualibs} -- cgit v1.2.3 From 5868b9d15ebca57f7ead09140e139dbec798e1ce Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 12 Nov 2010 07:05:22 +0200 Subject: Remove --database-dir and --sys options * --database-dir is useless anyway since we don't support loading names database from arbitrary path. * --sys (and mkluatexfontdb-sys) are dangerous since we will load user specific fonts (in ~/.fonts for example) which can not be loaded by other users (can be security concern as well). If there is real need, we should then implement it properly. + some clean up and less code duplication in mkluatexfontdb. --- luaotfload.dtx | 3 +-- mkluatexfontdb.lua | 58 +++++++++--------------------------------------------- otfl-font-nms.lua | 24 ++++++++++++++-------- 3 files changed, 26 insertions(+), 59 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 30898f6..8cd09f2 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -565,8 +565,7 @@ luaotfload.loadmodule('font-dum.lua') % % This is a patch for |otfl-font-def.lua|, that defines a reader for ofm % fonts, this is necessary if we set the forced field of the specification -% to |ofm|, we use it only when using \textsf{luaotfload}, not -% |mkluatexfontdb|. +% to |ofm|. % % \begin{macrocode} if fonts and fonts.tfm and fonts.tfm.readers then diff --git a/mkluatexfontdb.lua b/mkluatexfontdb.lua index 98db095..dc46ac0 100755 --- a/mkluatexfontdb.lua +++ b/mkluatexfontdb.lua @@ -18,11 +18,6 @@ local version = '1.07' -- same version number as luaotfload local names = fonts.names --- the directory in which the database will be saved, can be overwritten -local output_directory = names.path.localdir - -local log = logs.report - local function help_msg() texio.write(string.format([[ Usage: %s [OPTION]... @@ -30,14 +25,11 @@ Usage: %s [OPTION]... Rebuild the LuaTeX font database. Valid options: - -d --database-dir=DIRECTORY install the database in the specified directory -f --force force re-indexing all fonts -q --quiet don't output anything -v --verbose=LEVEL be more verbose (print the searched directories) -vv print the loaded fonts -vvv print all steps of directory searching - --sys install the database system-wide - (default is only for the current user) -V --version print version and exit -h --help print this message @@ -60,9 +52,10 @@ the list. For example (using a bash shell), export OSFONTDIR='/path/to/other/fonts:/Users/will/Library/Fonts:...' -The output database file is named otfl-fonts.lua. By default it is placed -in $TEXMFVAR/luatex-cache/generic/names." -]], name)) +The output database file is named otfl-fonts.lua and is placed under: + + %s" +]], name, names.path.localdir)) end local function version_msg() @@ -76,16 +69,14 @@ Here we fill cmdargs with the good values, and then analyze it. --]] local long_opts = { - ['database-dir'] = "d", force = "f", quiet = "q", help = "h", - sys = 0 , verbose = 1 , version = "V", } -local short_opts = "d:fqpvVh" +local short_opts = "fqpvVh" local force_reload = nil @@ -107,50 +98,19 @@ local function process_cmdline() elseif v == "h" then help_msg() os.exit(0) - elseif v == "d" then - output_directory = optarg [i] elseif v == "f" then force_reload = 1 - elseif v == "sys" then - output_directory = names.path.systemdir end end - if string.match(arg[0], '-sys') then - output_directory = names.path.systemdir - end - output_directory = fonts.path_normalize(output_directory) names.set_log_level(log_level) end -process_cmdline() - local function generate(force) - local savepath = output_directory - if not lfs.isdir(savepath) then - log("creating directory %s", savepath) - dir.mkdirs(savepath) - if not lfs.isdir(savepath) then - texio.write_nl(string.format("Error: cannot create directory '%s', exiting.\n", savepath)) - os.exit(1) - end - end - savepath = file.join(savepath, names.path.basename) - local fh = io.open(savepath, 'a+') - if not fh then - texio.write_nl(string.format("Error: cannot write file '%s', exiting.\n", savepath)) - os.exit(1) - end - fh:close() - local fontnames - if not force_reload and file.isreadable(savepath) then - fontnames = dofile(savepath) - else - fontnames = nil - end + local fontnames, saved fontnames = names.update(fontnames, force) - log("%s fonts in the database", #fontnames.mappings) - table.tofile(savepath, fontnames, true) - log("saved font names database in %s\n", savepath) + logs.report("%s fonts in the database", #fontnames.mappings) + saved = names.save(fontnames) end +process_cmdline() generate(force_reload) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 938b6bd..b565aac 100644 --- a/otfl-font-nms.lua +++ b/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 -- cgit v1.2.3 From c62354facf165b7aad7af69e885bbf406b5794ed Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 17 Nov 2010 19:47:57 +0200 Subject: Some cosmetic changes --- luaotfload.dtx | 98 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 8cd09f2..97fe748 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -2,6 +2,7 @@ % % Copyright (C) 2009-2010 by Elie Roux % and Khaled Hosny +% (Support: .) % % This work is under the CC0 license. % @@ -35,7 +36,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luaotfload 2010/11/11 v1.21 OpenType layout system} +\Msg{* Package: luaotfload v1.21 OpenType layout system} \Msg{************************************************************************} \keepsilent @@ -48,6 +49,7 @@ This is a generated file. Copyright (C) 2009-2010 by by Elie Roux and Khaled Hosny + (Support: .) This work is under the CC0 license. @@ -104,7 +106,7 @@ and the derived files \ProvidesFile{luaotfload.drv}% [2010/11/11 v1.21 OpenType layout system]% \documentclass{ltxdoc} -\usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor} +\usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor,xspace} \usepackage{charter} \usepackage[ bookmarks=true, @@ -120,8 +122,13 @@ and the derived files \definecolor{niceblue}{rgb}{0.4,0.6,1.000} -\def\LuaTeX{Lua\TeX} -\def\ConTeXt{Con\TeX t} +\newcommand\tex {\TeX\xspace} +\newcommand\pdftex {PDF\TeX\xspace} +\newcommand\luatex {Lua\TeX\xspace} +\newcommand\xetex {\XeTeX\xspace} +\newcommand\context{Con\TeX t\xspace} + +\newcommand*\email[1]{\href{mailto:#1}{#1}} \EnableCrossrefs \CodelineIndex @@ -154,13 +161,13 @@ and the derived files % % \title{The \textsf{luaotfload} package} % \date{2010/11/11 v1.21} -% \author{ Elie Roux\footnote{\texttt{elie.roux@telecom-bretagne.eu}} -% \and Khaled Hosny\footnote{\texttt{khaledhosny@eglug.org}}} +% \author{Elie Roux and Khaled Hosny\\ +% Support: \email{lualatex-dev@tug.org}} % % \maketitle % % \begin{abstract} -% This package is an adaptation of the \ConTeXt\ font loading system, +% This package is an adaptation of the \context font loading system, % providing the ability to load \textsf{OpenType} fonts with extended font % loading syntax supporting a large selection of OpenType font features. % \end{abstract} @@ -169,10 +176,10 @@ and the derived files % % \section{Introduction} % -% Font management and installation has always been painful with \TeX. +% Font management and installation has always been painful with \tex. % A lot of files are needed for one font (tfm, pfb, map, fd, vf), and as -% \TeX\ is 8-bit each font is limited to 256 characters. -% But the font world has evolved since \TeX, and new font technologies have +% \tex is 8-bit each font is limited to 256 characters. +% But the font world has evolved since \tex, and new font technologies have % appeared, most notably the so called \emph{smart font} technologies like % \textsf{OpenType} fonts. These fonts can contain a lot of characters, and % additional functionalities like ligatures, old-style numbers, small capitals, @@ -181,12 +188,12 @@ and the derived files % scripts right now} scripts. % They are widely deployed and available for all modern operating systems and % are becoming the de facto standard fonts for advanced text layout. -% Until now the only way to use them directly in the \TeX\ world was by using -% them with \XeTeX. +% Until now the only way to use them directly in the \tex world was by using +% them with \xetex. % -% Unlike \XeTeX, \LuaTeX\ does not provide direct support for using these fonts +% Unlike \xetex, \luatex does not provide direct support for using these fonts % by default, but it provides a way to hook Lua code in some points of the -% \TeX\ processing; for instance, we can improve the font loading system, and +% \tex processing; for instance, we can improve the font loading system, and % text procession, which what this package is about. % % \section{Loading fonts} @@ -195,7 +202,7 @@ and the derived files % like: % % \begin{center} -% |\font\foo={|\meta{prefix}|:|\meta{font name}|:|\meta{font features}|}| \meta{\TeX\ font features} +% |\font\foo={|\meta{prefix}|:|\meta{font name}|:|\meta{font features}|}| \meta{\tex font features} % \end{center} % % \noindent @@ -208,7 +215,7 @@ and the derived files % whether to use a select the font from its filename or font name, % respectively. If no prefix is specified, then \texttt{file:} is assumed. % -% For compatibility with \XeTeX, surrounding the \meta{font name} +% For compatibility with \xetex, surrounding the \meta{font name} % with square brackets is synonymous to using the \texttt{file:} prefix. % % Accessing fonts by fontname allows loading system installed fonts as well as @@ -249,7 +256,7 @@ and the derived files % \texttt{base} or \texttt{node}. % Using \texttt{mode=base} % only supports a subset of OpenType features and works by mapping those -% features to traditional \TeX\ ligature and kerning mechanisms and is a bit +% features to traditional \tex ligature and kerning mechanisms and is a bit % faster % Using \texttt{mode=node} hopefully supports OpenType fully and % works by direct processing of the node list with Lua; it is slower and @@ -272,9 +279,8 @@ and the derived files % feature files are textual representation of OpenType tables and can be used to % extend OpenType features of the font on fly. The file name of the feature file % is passed, then features defined in the file can be enabled/disabled like any -% other feature. The actual syntax is described at -% \url{http://fontforge.sourceforge.net/featurefile.html} and -% \url{http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html}. +% other feature. The syntax is documented in Adobe's +% \href{http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html}{OpenType Feature File Specification}. % % For example, to set a |tkrn| feature from |mykern.fea| file: % @@ -298,7 +304,7 @@ and the derived files % % For example, to enable default protrusion\footnote{You also need to set % |\pdfprotrudechars2 \pdfadjustspacing2| to activate protrusion and expansion, -% respectively. See PDF\TeX\ manual for details}: +% respectively. See \pdftex manual for details}: % % |\font\lmr=Latin Modern Roman:protrusion=default| % @@ -311,19 +317,19 @@ and the derived files % \begin{itemize*} % \item \texttt{anum}: replaces European numbers with eastern Arabic numbers or % Persian numbers, depending on the value of |language|. -% \item \texttt{tlig}: applies legacy \TeX\ ligatures (|``''-- -- !` ?` <<>>|). -% \item \texttt{trep}: applies legacy \TeX\ replacements (|`'"|). +% \item \texttt{tlig}: applies legacy \tex ligatures (|``''-- -- !` ?` <<>>|). +% \item \texttt{trep}: applies legacy \tex replacements (|`'"|). % \end{itemize*} % -% (For \XeTeX\ users: these last two are the equivalent of writing -% \texttt{mapping=text-tex} using \XeTeX's input remapping feature.) +% (For \xetex users: these last two are the equivalent of writing +% \texttt{mapping=text-tex} using \xetex's input remapping feature.) % % % \section{Font names database} % \label{sec:fontdb} % % As introduced in the previous section, \textsf{luaotfload} uses a database -% to keep track of fonts available to \LuaTeX. Using this database, fonts can +% to keep track of fonts available to \luatex. Using this database, fonts can % be loaded by font name as well as filename. % % When \textsf{luaotfload} is asked to load a font by font name, it will check @@ -363,7 +369,7 @@ and the derived files % % \subsection{Blacklisting fonts} % -% Some fonts are problematic in \LuaTeX, if you found that your document takes +% Some fonts are problematic in \luatex, if you found that your document takes % too long to compile, or eats all the free memory, you can find the culprit % file by running |mkluatexfontdb| utility with |-v| option to see which font % file it is stuck with. You can then instruct \textsf{luaotfload} to ignore @@ -374,17 +380,17 @@ and the derived files % can find. You can either use the base name or the full path. Any thing after % a |%| sign is ignored. % -% \section{Required \ConTeXt\ files} +% \section{Required \context files} % -% This package is a wrapper for several files taken from the \ConTeXt\ macro -% package. The philosophy is to let \ConTeXt\ do all the implementation and +% This package is a wrapper for several files taken from the \context macro +% package. The philosophy is to let \context do all the implementation and % update these files from time to time. To do so we did not modify the files -% taken from \ConTeXt, we only changed their names to prevent name clashes. +% taken from \context, we only changed their names to prevent name clashes. % You can thus update the font system of this package simply by updating the -% files taken from \ConTeXt, without (theoretically) changing the \texttt{.sty} +% files taken from \context, without (theoretically) changing the \texttt{.sty} % file nor the main \texttt{.lua} file. % -% The \ConTeXt\ files are renamed by adding the prefix \texttt{otfl-} to them +% The \context files are renamed by adding the prefix \texttt{otfl-} to them % (\texttt{otfl} as \texttt{OTF L}oad). The files are: % % \begin{multicols}{3} @@ -471,7 +477,7 @@ local error, warning, info, log = luatexbase.provides_module(luaotfload.module) kpse.init_prog('', 600, '/') % \end{macrocode} % -% The minimal required \LuaTeX\ version. +% The minimal required \luatex version. % % \begin{macrocode} local luatex_version = 60 @@ -485,8 +491,8 @@ end % % \subsection{Module loading} % -% We load the \ConTeXt\ files with this function. It automatically adds the -% \texttt{otfl-} prefix to it, so that we call it with the actual \ConTeXt\ +% We load the \context files with this function. It automatically adds the +% \texttt{otfl-} prefix to it, so that we call it with the actual \context % name. % % \begin{macrocode} @@ -503,8 +509,8 @@ end % \end{macrocode} % % We start loading some lua files. These two are some code not used by -% \ConTeXt\ at all that allow other modules to be used, it provides some -% low-level \ConTeXt\ functions. +% \context at all that allow other modules to be used, it provides some +% low-level \context functions. % % \begin{macrocode} luaotfload.loadmodule('luat-dum.lua') -- not used in context at all @@ -512,7 +518,7 @@ 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\ +% A hack to remove a warning from \texttt{node-dum.lua} as it is \context % specific. % % \begin{macrocode} @@ -527,7 +533,7 @@ luaotfload.loadmodule('node-dum.lua') luaotfload.loadmodule('node-inj.lua') % \end{macrocode} % -% By default \ConTeXt\ takes some private attributes for internal use. To +% By default \context takes some private attributes for internal use. To % avoide attribute clashes with other packages, we override the function % that allocates new attributes, making it a wraper around % |luatexbase.new_attribute()|. We also prefix attributes with |otfl@| to @@ -583,7 +589,7 @@ luaotfload.loadmodule('font-clr.lua') % \subsection{Post-processing TFM table} % % Here we do some final touches to the loaded TFM table before passing it -% to the \TeX\ end. +% to the \tex end. % % \begin{macrocode} local function def_font(...) @@ -591,7 +597,7 @@ local function def_font(...) if type(fontdata) == "table" and fontdata.shared then % \end{macrocode} % -% First, we add some code to emulate \XeTeX's \cs{fontdimen8}, +% First, we add some code to emulate \xetex's \cs{fontdimen8}, % which stores the caps-height of the font. (Cf.\ \cs{fontdimen5} which % stores the x-height.) % @@ -638,9 +644,9 @@ local function def_font(...) fontdata.MathConstants = mc % \end{macrocode} % -% \LuaTeX\ does not provide interface to accessing +% \luatex does not provide interface to accessing % \texttt{(Script)ScriptPercentScaleDown} math constants, so we emulate -% \XeTeX\ behaviour by setting \cs{fontdimen10} and \cs{fontdimen11}. +% \xetex behaviour by setting \cs{fontdimen10} and \cs{fontdimen11}. % % \begin{macrocode} if mc["ScriptPercentScaleDown"] then @@ -660,9 +666,9 @@ local function def_font(...) end % \end{macrocode} % -% \subsection{\ConTeXt\ override} +% \subsection{\context override} % -% Here we override some defaults set in \ConTeXt\ code. +% Here we override some defaults set in \context code. % % \begin{macrocode} fonts.mode = "node" -- cgit v1.2.3 From 716197db659c9c05baa2d1f701e32007cf2523d7 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 17 Nov 2010 19:50:56 +0200 Subject: Remove misleading statement Mer copying of files over from ConTeXt is no longer possible and should not be suggested. --- luaotfload.dtx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 97fe748..1db05f2 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -384,11 +384,9 @@ and the derived files % % This package is a wrapper for several files taken from the \context macro % package. The philosophy is to let \context do all the implementation and -% update these files from time to time. To do so we did not modify the files -% taken from \context, we only changed their names to prevent name clashes. -% You can thus update the font system of this package simply by updating the -% files taken from \context, without (theoretically) changing the \texttt{.sty} -% file nor the main \texttt{.lua} file. +% update these files from time to time. So we try not to modify the files +% taken from \context as far as possible, but we changed their names to +% prevent name clashes. % % The \context files are renamed by adding the prefix \texttt{otfl-} to them % (\texttt{otfl} as \texttt{OTF L}oad). The files are: -- cgit v1.2.3 From 9cdb60a667d2689e78ff5d7109266c4d25fb2897 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 17 Nov 2010 19:55:23 +0200 Subject: Minor --- luaotfload.dtx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 1db05f2..322acb8 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -126,6 +126,7 @@ and the derived files \newcommand\pdftex {PDF\TeX\xspace} \newcommand\luatex {Lua\TeX\xspace} \newcommand\xetex {\XeTeX\xspace} +\newcommand\latex {\LaTeX\xspace} \newcommand\context{Con\TeX t\xspace} \newcommand*\email[1]{\href{mailto:#1}{#1}} @@ -730,7 +731,7 @@ end %<*package> % \fi % -% Classical Plain+\LaTeX\ package initialization. +% Classical Plain+\latex package initialization. % % \begin{macrocode} \csname ifluaotfloadloaded\endcsname -- cgit v1.2.3 From 68deea6dce2d816a208b940cdfb529e976d5dfa6 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 17 Nov 2010 20:15:09 +0200 Subject: Simplify callback registering We never turn off the package as it makes no sense to load it then (and it does not really turn everything off since we already register another callback in the color module. --- luaotfload.dtx | 58 +++++++++++++++++----------------------------------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 322acb8..683481c 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -690,35 +690,22 @@ for _,v in next, gsubs do end % \end{macrocode} % -% Finally two functions +% Finally we register the callbacks % % \begin{macrocode} -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{macrocode} % % \iffalse @@ -755,26 +742,15 @@ end \catcode64 11 % \end{macrocode} % -% Two small macros to register or unregister the callbacks. Without the -% callbacks this package is totally turned off. +% Finally we load the |lua| module % % \begin{macrocode} -\def\otfl@off{ -\directlua{luaotfload.unregister_callbacks()} -} - -\def\otfl@on{ -\directlua{luaotfload.register_callbacks()} -} +\RequireLuaModule{luaotfload} % \end{macrocode} % -% We load the |lua| file, and we turn the package on. +% and finalize the package. % % \begin{macrocode} -\RequireLuaModule{luaotfload} - -\otfl@on - \otfl@AtEnd % \end{macrocode} % \iffalse -- cgit v1.2.3 From 45b788e4736369be90c39f938012960c6dd7d3ea Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 17 Nov 2010 20:20:47 +0200 Subject: Not needed anymore Pretending I knew what it does. --- luaotfload.dtx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 683481c..9577eea 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -733,26 +733,15 @@ luatexbase.add_to_callback('find_vf_file', [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 +\RequireLuaModule{lualibs} % \end{macrocode} % -% Finally we load the |lua| module +% Finally we load the |lua| module. % % \begin{macrocode} \RequireLuaModule{luaotfload} % \end{macrocode} -% -% and finalize the package. -% -% \begin{macrocode} -\otfl@AtEnd -% \end{macrocode} % \iffalse % % \fi -- cgit v1.2.3 From 8166a5e9f5e1aba799f25498651bb582102ed0a8 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 26 Nov 2010 17:36:23 +0200 Subject: Apply Philipp's patch from #20 --- luaotfload.dtx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 9577eea..c4e4e27 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -591,6 +591,10 @@ luaotfload.loadmodule('font-clr.lua') % to the \tex end. % % \begin{macrocode} +local function default_callback(fontdata) + -- do nothing +end +luatexbase.create_callback("luaotfload.patch_font", "simple", default_callback) local function def_font(...) local fontdata = fonts.define.read(...) if type(fontdata) == "table" and fontdata.shared then @@ -659,7 +663,7 @@ local function def_font(...) fontdata.parameters[11] = 50 end end - + luatexbase.call_callback("luaotfload.patch_font", fontdata) end return fontdata end @@ -688,6 +692,10 @@ local gsubs = { for _,v in next, gsubs do register_base_sub(v) end + +function luaotfload.add_patch_callback(...) + luatexbase.add_to_callback("luaotfload.patch_font", ...) +end % \end{macrocode} % % Finally we register the callbacks -- cgit v1.2.3 From 86eaa7f9ef6bfa167456b0274c93bb958c6b6611 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 26 Nov 2010 17:47:59 +0200 Subject: Some documentation --- luaotfload.dtx | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index c4e4e27..535da0d 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -590,17 +590,21 @@ luaotfload.loadmodule('font-clr.lua') % Here we do some final touches to the loaded TFM table before passing it % to the \tex end. % +% First we create a callback for patching fonts on the fly, to be used by +% other packages. +% \begin{macrocode} +luatexbase.create_callback("luaotfload.patch_font", "simple", function() end) +% \end{macrocode} +% +% then define a function where font manipulation will take place. +% % \begin{macrocode} -local function default_callback(fontdata) - -- do nothing -end -luatexbase.create_callback("luaotfload.patch_font", "simple", default_callback) local function def_font(...) local fontdata = fonts.define.read(...) if type(fontdata) == "table" and fontdata.shared then % \end{macrocode} % -% First, we add some code to emulate \xetex's \cs{fontdimen8}, +% Here we add some code to emulate \xetex's \cs{fontdimen8}, % which stores the caps-height of the font. (Cf.\ \cs{fontdimen5} which % stores the x-height.) % @@ -608,6 +612,8 @@ local function def_font(...) % necessary information. % This needs to be extended for fonts that don't contain an `X'. % +% XXX: move to \texttt{fontspec}. +% % \begin{macrocode} local capheight local units = fontdata.units @@ -647,9 +653,11 @@ local function def_font(...) 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}. +% \luatex does not provide interface to accessing +% \texttt{(Script)ScriptPercentScaleDown} math constants, so we emulate +% \xetex behaviour by setting \cs{fontdimen10} and \cs{fontdimen11}. +% +% XXX: move to \texttt{unicode-math}. % % \begin{macrocode} if mc["ScriptPercentScaleDown"] then @@ -663,6 +671,11 @@ local function def_font(...) fontdata.parameters[11] = 50 end end +% \end{macrocode} +% +% Execute any registered font patching callbacks. +% +% \begin{macrocode} luatexbase.call_callback("luaotfload.patch_font", fontdata) end return fontdata @@ -692,7 +705,11 @@ local gsubs = { for _,v in next, gsubs do register_base_sub(v) end - +% \end{macrocode} +% +% Function to register font patching callbacks. +% +% \begin{macrocode} function luaotfload.add_patch_callback(...) luatexbase.add_to_callback("luaotfload.patch_font", ...) end -- cgit v1.2.3 From ea99932d684f7a7e9e320edc8b86b43f992579f1 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 26 Nov 2010 17:54:59 +0200 Subject: Test file --- tests/font_patch.tex | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/font_patch.tex diff --git a/tests/font_patch.tex b/tests/font_patch.tex new file mode 100644 index 0000000..a8820b1 --- /dev/null +++ b/tests/font_patch.tex @@ -0,0 +1,24 @@ +\input{luaotfload.sty} +\directlua { + local function patch_font(fontdata) + local mc = fontdata.MathConstants + local em = fontdata.units + local sz = fontdata.size + if fontdata.psname == "CambriaMath" and mc then + mc.DisplayOperatorMinHeight = 2800 / em * sz + end + end + luaotfload.add_patch_callback(patch_font, "modernmath.patch_font") +} + +\font\4={name:Cambria Math:mode=base;script=math} at 10pt +\font\5={name:Cambria Math:mode=base;script=math;ssty=1} at 7pt +\font\6={name:Cambria Math:mode=node;script=math;ssty=2} at 5pt +\textfont4=\4 \scriptfont4=\5 \scriptscriptfont4=\6 + +$$ +\Umathchar"1"4`∫ +\Umathchar"1"4`∑ +$$ +\bye + -- cgit v1.2.3 From b3932a4a4ae41aa0fd19ab442513d884c78a0548 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 26 Nov 2010 17:55:12 +0200 Subject: Minor --- luaotfload.dtx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 535da0d..2192e12 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -647,8 +647,8 @@ 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 % \end{macrocode} @@ -661,12 +661,12 @@ local function def_font(...) % % \begin{macrocode} 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 -- cgit v1.2.3 From 5aea89f6d96d6014e559b960096371c5b7e06968 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 26 Nov 2010 18:37:31 +0200 Subject: Remove `luaotfload.add_patch_callback()` Per Philip's suggestion, `luatexbase.add_to_callback()` is to be used directly instead. --- luaotfload.dtx | 8 -------- tests/font_patch.tex | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 2192e12..eb53461 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -707,14 +707,6 @@ for _,v in next, gsubs do end % \end{macrocode} % -% Function to register font patching callbacks. -% -% \begin{macrocode} -function luaotfload.add_patch_callback(...) - luatexbase.add_to_callback("luaotfload.patch_font", ...) -end -% \end{macrocode} -% % Finally we register the callbacks % % \begin{macrocode} diff --git a/tests/font_patch.tex b/tests/font_patch.tex index a8820b1..e096551 100644 --- a/tests/font_patch.tex +++ b/tests/font_patch.tex @@ -1,6 +1,6 @@ \input{luaotfload.sty} \directlua { - local function patch_font(fontdata) + local function patch(fontdata) local mc = fontdata.MathConstants local em = fontdata.units local sz = fontdata.size @@ -8,7 +8,7 @@ mc.DisplayOperatorMinHeight = 2800 / em * sz end end - luaotfload.add_patch_callback(patch_font, "modernmath.patch_font") + luatexbase.add_to_callback("luaotfload.patch_font", patch, "cambria.domh") } \font\4={name:Cambria Math:mode=base;script=math} at 10pt -- cgit v1.2.3 From 2ffaa2ee29c05d2e3655cd4411c0c5d321e60eef Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 25 Jan 2011 01:06:40 +0200 Subject: Prepare for release --- NEWS | 5 +++++ luaotfload.dtx | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 6fda942..955c5fe 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,11 @@ Change History -------------- +2011/01/25, luaotfload v1.22: + * Remove --database-dir and --sys options from mkluatexfontdb + * Provide a "luaotfload.patch_font" callback for on the fly patching of fonts + * Some documentation improvements + 2010/11/11, luaotfload v1.21: * Adapt to luatexbase v3.0 diff --git a/luaotfload.dtx b/luaotfload.dtx index eb53461..e19e8dc 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -36,7 +36,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luaotfload v1.21 OpenType layout system} +\Msg{* Package: luaotfload v1.22 OpenType layout system} \Msg{************************************************************************} \keepsilent @@ -104,7 +104,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaotfload.drv}% - [2010/11/11 v1.21 OpenType layout system]% + [2011/01/25 v1.22 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor,xspace} \usepackage{charter} @@ -161,7 +161,7 @@ and the derived files % \GetFileInfo{luaotfload.drv} % % \title{The \textsf{luaotfload} package} -% \date{2010/11/11 v1.21} +% \date{2011/01/25 v1.22} % \author{Elie Roux and Khaled Hosny\\ % Support: \email{lualatex-dev@tug.org}} % @@ -455,8 +455,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", @@ -747,7 +747,7 @@ luatexbase.add_to_callback('find_vf_file', \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2010/11/11 v1.21 OpenType layout system] + [2011/01/25 v1.22 OpenType layout system] \RequirePackage{luatexbase} \fi -- cgit v1.2.3 From 5a0f9c788ce3acc6bb0bfcc79c39e060e0168136 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 4 Feb 2011 16:05:09 +0200 Subject: Fix a typo in fonts.names.scan() This was a debugging leftover that went unnoticed. --- otfl-font-nms.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index b565aac..828359b 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -678,7 +678,7 @@ local function scan_external_dir(dir) loaded = true end new_names = table.copy(old_names) - scan_dir("zapfino", old_names, new_names) + scan_dir(dir, old_names, new_names) names.data = new_names end -- cgit v1.2.3 From 954ff3284ad0a7ffa11ce64b05afedba7d09c713 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 4 Feb 2011 16:08:56 +0200 Subject: Prepare for release --- NEWS | 3 +++ luaotfload.dtx | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 955c5fe..a3ea1d2 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ Change History -------------- +2011/02/04, luaotfload v1.23: + * Fix a typo breaking fonts.names.scan() + 2011/01/25, luaotfload v1.22: * Remove --database-dir and --sys options from mkluatexfontdb * Provide a "luaotfload.patch_font" callback for on the fly patching of fonts diff --git a/luaotfload.dtx b/luaotfload.dtx index e19e8dc..958c4f1 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -36,7 +36,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luaotfload v1.22 OpenType layout system} +\Msg{* Package: luaotfload v1.23 OpenType layout system} \Msg{************************************************************************} \keepsilent @@ -104,7 +104,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaotfload.drv}% - [2011/01/25 v1.22 OpenType layout system]% + [2011/02/04 v1.23 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor,xspace} \usepackage{charter} @@ -161,7 +161,7 @@ and the derived files % \GetFileInfo{luaotfload.drv} % % \title{The \textsf{luaotfload} package} -% \date{2011/01/25 v1.22} +% \date{2011/02/04 v1.23} % \author{Elie Roux and Khaled Hosny\\ % Support: \email{lualatex-dev@tug.org}} % @@ -455,8 +455,8 @@ module('luaotfload', package.seeall) luaotfload.module = { name = "luaotfload", - version = 1.22, - date = "2011/01/25", + version = 1.23, + date = "2011/02/04", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", @@ -747,7 +747,7 @@ luatexbase.add_to_callback('find_vf_file', \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2011/01/25 v1.22 OpenType layout system] + [2011/02/04 v1.23 OpenType layout system] \RequirePackage{luatexbase} \fi -- cgit v1.2.3 From 9a6fb44bd9e80bc41d78c58eb6d7bb38cd692672 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 5 Feb 2011 23:49:30 +0200 Subject: Fix infinite loop names.load() calls names.update() without an argument if no font database is found, but the later will call the former if invoked without an argument. Now calling names.update() with an empty names database. fixes #23 --- otfl-font-nms.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 828359b..d32f22f 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -68,7 +68,7 @@ local function load_names() else logs.info([[Font names database not found, generating new one. This can take several minutes; please be patient.]]) - data = names.update() + data = names.update(fontnames_init()) names.save(data) end return data -- cgit v1.2.3 From d9be74ddadb95df36a0ffe08343190cf3a77dbfa Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 16 Feb 2011 17:28:35 +0200 Subject: Prepare for release --- NEWS | 3 +++ luaotfload.dtx | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index a3ea1d2..ee579ed 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ Change History -------------- +2011/02/16, luaotfload v1.24: + * Fix infinite loop first time creating a name list + 2011/02/04, luaotfload v1.23: * Fix a typo breaking fonts.names.scan() diff --git a/luaotfload.dtx b/luaotfload.dtx index 958c4f1..19286d5 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -36,7 +36,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luaotfload v1.23 OpenType layout system} +\Msg{* Package: luaotfload v1.24 OpenType layout system} \Msg{************************************************************************} \keepsilent @@ -104,7 +104,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaotfload.drv}% - [2011/02/04 v1.23 OpenType layout system]% + [2011/02/16 v1.24 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor,xspace} \usepackage{charter} @@ -161,7 +161,7 @@ and the derived files % \GetFileInfo{luaotfload.drv} % % \title{The \textsf{luaotfload} package} -% \date{2011/02/04 v1.23} +% \date{2011/02/16 v1.24} % \author{Elie Roux and Khaled Hosny\\ % Support: \email{lualatex-dev@tug.org}} % @@ -455,8 +455,8 @@ module('luaotfload', package.seeall) luaotfload.module = { name = "luaotfload", - version = 1.23, - date = "2011/02/04", + version = 1.24, + date = "2011/02/16", description = "OpenType layout system.", author = "Elie Roux & Hans Hagen", copyright = "Elie Roux", @@ -747,7 +747,7 @@ luatexbase.add_to_callback('find_vf_file', \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luaotfload}% - [2011/02/04 v1.23 OpenType layout system] + [2011/02/16 v1.24 OpenType layout system] \RequirePackage{luatexbase} \fi -- cgit v1.2.3 From e9db0c1b4d5a293ed433fecc04262d841abd89bf Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 20 Feb 2011 20:49:06 +0200 Subject: Code for setting \fontdimen8 moved to fontspec --- luaotfload.dtx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 19286d5..091c16a 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -604,34 +604,6 @@ local function def_font(...) if type(fontdata) == "table" and fontdata.shared then % \end{macrocode} % -% Here we add some code to emulate \xetex's \cs{fontdimen8}, -% which stores the caps-height of the font. (Cf.\ \cs{fontdimen5} which -% stores the x-height.) -% -% Falls back to measuring the glyph if the font doesn't contain the -% necessary information. -% This needs to be extended for fonts that don't contain an `X'. -% -% XXX: move to \texttt{fontspec}. -% -% \begin{macrocode} - local capheight - local units = fontdata.units - local size = fontdata.size - local otfdata = fontdata.shared.otfdata - - if otfdata.pfminfo.os2_capheight > 0 then - capheight = otfdata.pfminfo.os2_capheight / units * size - else - if fontdata.characters[string.byte("X")] then - capheight = fontdata.characters[string.byte("X")].height - else - capheight = otfdata.metadata.ascent / units * size - end - end - fontdata.parameters[8] = capheight -% \end{macrocode} -% % Then we populate \texttt{MathConstants} table, which is required for % OpenType math. % -- cgit v1.2.3 From 65e4796e902a55d952cc6f90d277632d9b947c84 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 20 Feb 2011 21:35:42 +0200 Subject: Code for setting \fontdimen10|11 moved to unicode-math --- luaotfload.dtx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 091c16a..a1cd68d 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -623,25 +623,6 @@ 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}. -% -% XXX: move to \texttt{unicode-math}. -% -% \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{macrocode} % -- cgit v1.2.3 From e4479abbf88833d6ee6e0f9fa341507d4eecd367 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 21 Feb 2011 22:48:57 +0200 Subject: Kpathsea does not know "truetype dictionary" See http://www.ntg.nl/pipermail/dev-luatex/2011-February/004120.html --- otfl-luat-dum.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/otfl-luat-dum.lua b/otfl-luat-dum.lua index 9607697..2f6627f 100644 --- a/otfl-luat-dum.lua +++ b/otfl-luat-dum.lua @@ -56,7 +56,7 @@ local remapper = { otf = "opentype fonts", ttf = "truetype fonts", ttc = "truetype fonts", - dfont = "truetype dictionary", + dfont = "truetype fonts", cid = "cid maps", fea = "font feature files", } -- cgit v1.2.3 From d33e9b945f7ab98c9879b95f3ac51c56dcf81803 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 25 Feb 2011 18:25:09 +0200 Subject: Misc. documentation fixes And update the mode section to reflect current defaults. --- luaotfload.dtx | 171 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 84 insertions(+), 87 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index a1cd68d..0308865 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -107,6 +107,7 @@ and the derived files [2011/02/16 v1.24 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor,xspace} +\usepackage{lmodern} \usepackage{charter} \usepackage[ bookmarks=true, @@ -212,12 +213,12 @@ and the derived files % % \paragraph{Prefix} % -% The \meta{prefix} be either \texttt{file:} or \texttt{name:}, which specify +% The \meta{prefix} be either |file:| or |name:|, which specify % whether to use a select the font from its filename or font name, -% respectively. If no prefix is specified, then \texttt{file:} is assumed. +% respectively. If no prefix is specified, then |file:| is assumed. % % For compatibility with \xetex, surrounding the \meta{font name} -% with square brackets is synonymous to using the \texttt{file:} prefix. +% with square brackets is synonymous to using the |file:| prefix. % % Accessing fonts by fontname allows loading system installed fonts as well as % \textsc{texmf} ones, and requires a font names database; see @@ -253,20 +254,16 @@ and the derived files % The supported keys are: % \begin{description} % \item [mode] \hfill \\ -% \textsf{luaotfload} has two OpenType processing modes; -% \texttt{base} or \texttt{node}. -% Using \texttt{mode=base} -% only supports a subset of OpenType features and works by mapping those -% features to traditional \tex ligature and kerning mechanisms and is a bit -% faster -% Using \texttt{mode=node} hopefully supports OpenType fully and -% works by direct processing of the node list with Lua; it is slower and -% is not designed to work in math mode. -% -% By default \texttt{mode=base} is used, but it is advisable to always -% enable \texttt{node} made, except for math fonts, otherwise many OpenType -% features will not function properly or even not work at all, especially for -% advanced scripts like Arabic. +% \textsf{luaotfload} has two OpenType processing modes; |base| and +% |node|. |base| mode works mapping those features to traditional +% \tex ligature and kerning mechanisms and thus supports only a subset of +% OpenType features but is a bit faster and is the only processing mode +% supports in math mode. |node| works by direct processing of the node +% list at Lua end and have more wide support of OpenType features but is a bit +% slower. +% +% By default |node| mode is used, and you have to manually force +% |base| mode when needed e.g. for math fonts. % % \item [script] \hfill \\ % OpenType script string, default value is |dflt|. Some fonts don't assign @@ -300,7 +297,7 @@ and the derived files % Both keys control microtypographic features of the font, namely glyph % protrusion and expansion. The value of the key is the name of predefined % Lua tables of protrusion and expansion values; see the end of -% \texttt{otfl-font-dum.lua} file for an example of such tables. The only +% |otfl-font-dum.lua| file for an example of such tables. The only % predefined value is |default|. % % For example, to enable default protrusion\footnote{You also need to set @@ -316,14 +313,14 @@ and the derived files % OpenType, currently three features are defined: % % \begin{itemize*} -% \item \texttt{anum}: replaces European numbers with eastern Arabic numbers or +% \item |anum|: replaces European numbers with eastern Arabic numbers or % Persian numbers, depending on the value of |language|. -% \item \texttt{tlig}: applies legacy \tex ligatures (|``''-- -- !` ?` <<>>|). -% \item \texttt{trep}: applies legacy \tex replacements (|`'"|). +% \item |tlig|: applies legacy \tex ligatures (|``''-- -- !` ?` <<>>|). +% \item |trep|: applies legacy \tex replacements (|`'"|). % \end{itemize*} % % (For \xetex users: these last two are the equivalent of writing -% \texttt{mapping=text-tex} using \xetex's input remapping feature.) +% |mapping=text-tex| using \xetex's input remapping feature.) % % % \section{Font names database} @@ -389,39 +386,39 @@ and the derived files % taken from \context as far as possible, but we changed their names to % prevent name clashes. % -% The \context files are renamed by adding the prefix \texttt{otfl-} to them -% (\texttt{otfl} as \texttt{OTF L}oad). The files are: +% The \context files are renamed by adding the prefix |otfl-| to them +% (|otfl| as |OTF L|oad). The files are: % % \begin{multicols}{3} % \begin{itemize*} -% \item \texttt{luat-dum.lua} -% \item \texttt{data-con.lua} -% \item \texttt{node-inj.lua} -% \item \texttt{node-dum.lua} -% \item \texttt{font-ini.lua} -% \item \texttt{font-tfm.lua} -% \item \texttt{font-cid.lua} -% \item \texttt{font-ott.lua} -% \item \texttt{font-otf.lua} -% \item \texttt{font-otd.lua} -% \item \texttt{font-oti.lua} -% \item \texttt{font-otb.lua} -% \item \texttt{font-otn.lua} -% \item \texttt{font-ota.lua} -% \item \texttt{font-otc.lua} -% \item \texttt{font-def.lua} -% \item \texttt{font-xtx.lua} -% \item \texttt{font-map.lua} -% \item \texttt{font-dum.lua} +% \item |luat-dum.lua| +% \item |data-con.lua| +% \item |node-inj.lua| +% \item |node-dum.lua| +% \item |font-ini.lua| +% \item |font-tfm.lua| +% \item |font-cid.lua| +% \item |font-ott.lua| +% \item |font-otf.lua| +% \item |font-otd.lua| +% \item |font-oti.lua| +% \item |font-otb.lua| +% \item |font-otn.lua| +% \item |font-ota.lua| +% \item |font-otc.lua| +% \item |font-def.lua| +% \item |font-xtx.lua| +% \item |font-map.lua| +% \item |font-dum.lua| % \end{itemize*} % \end{multicols} % % The following files have been written for this package: % \begin{multicols}{3} % \begin{itemize*} -% \item \texttt{font-clr.lua} -% \item \texttt{font-nms.lua} -% \item \texttt{luat-ovr.lua} +% \item |font-clr.lua| +% \item |font-nms.lua| +% \item |luat-ovr.lua| % \end{itemize*} % \end{multicols} % @@ -451,7 +448,7 @@ and the derived files % First some usual initializations. % % \begin{macrocode} -module('luaotfload', package.seeall) +module("luaotfload", package.seeall) luaotfload.module = { name = "luaotfload", @@ -473,7 +470,7 @@ local error, warning, info, log = luatexbase.provides_module(luaotfload.module) % fine even if |\pdfpkresolution| is changed. % % \begin{macrocode} -kpse.init_prog('', 600, '/') +kpse.init_prog("", 600, "/") % \end{macrocode} % % The minimal required \luatex version. @@ -482,7 +479,7 @@ kpse.init_prog('', 600, '/') local luatex_version = 60 if tex.luatexversion < luatex_version then - warning('LuaTeX v%.2f is old, v%.2f is recommended.', + warning("LuaTeX v%.2f is old, v%.2f is recommended.", tex.luatexversion/100, luatex_version /100) end @@ -491,18 +488,18 @@ end % \subsection{Module loading} % % We load the \context files with this function. It automatically adds the -% \texttt{otfl-} prefix to it, so that we call it with the actual \context +% |otfl-| prefix to it, so that we call it with the actual \context % name. % % \begin{macrocode} function luaotfload.loadmodule(name) - local tofind = 'otfl-'..name + local tofind = "otfl-"..name local found = kpse.find_file(tofind,"tex") if found then - log('loading file %s.', found) + log("loading file %s.", found) dofile(found) else - error('file %s not found.', tofind) + error("file %s not found.", tofind) end end % \end{macrocode} @@ -512,12 +509,12 @@ 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 +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 +% A hack to remove a warning from |node-dum.lua| as it is \context % specific. % % \begin{macrocode} @@ -527,9 +524,9 @@ tex.attribute[0] = 0 % Node support modules. % % \begin{macrocode} -luaotfload.loadmodule('font-ini.lua') -luaotfload.loadmodule('node-dum.lua') -luaotfload.loadmodule('node-inj.lua') +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 @@ -540,7 +537,7 @@ luaotfload.loadmodule('node-inj.lua') % % \begin{macrocode} function attributes.private(name) - local attr = 'otfl@' .. name + local attr = "otfl@" .. name local number = luatexbase.attributes[attr] if not number then number = luatexbase.new_attribute(attr) @@ -552,20 +549,20 @@ end % Font handling modules. % % \begin{macrocode} -luaotfload.loadmodule('font-tfm.lua') -luaotfload.loadmodule('font-cid.lua') -luaotfload.loadmodule('font-ott.lua') -luaotfload.loadmodule('font-map.lua') -luaotfload.loadmodule('font-otf.lua') -luaotfload.loadmodule('font-otd.lua') -luaotfload.loadmodule('font-oti.lua') -luaotfload.loadmodule('font-otb.lua') -luaotfload.loadmodule('font-otn.lua') -luaotfload.loadmodule('font-ota.lua') -luaotfload.loadmodule('font-otc.lua') -luaotfload.loadmodule('font-def.lua') -luaotfload.loadmodule('font-xtx.lua') -luaotfload.loadmodule('font-dum.lua') +luaotfload.loadmodule("font-tfm.lua") +luaotfload.loadmodule("font-cid.lua") +luaotfload.loadmodule("font-ott.lua") +luaotfload.loadmodule("font-map.lua") +luaotfload.loadmodule("font-otf.lua") +luaotfload.loadmodule("font-otd.lua") +luaotfload.loadmodule("font-oti.lua") +luaotfload.loadmodule("font-otb.lua") +luaotfload.loadmodule("font-otn.lua") +luaotfload.loadmodule("font-ota.lua") +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 @@ -581,8 +578,8 @@ end % \textsf{luaotfload} specific modules. % % \begin{macrocode} -luaotfload.loadmodule('font-nms.lua') -luaotfload.loadmodule('font-clr.lua') +luaotfload.loadmodule("font-nms.lua") +luaotfload.loadmodule("font-clr.lua") % \end{macrocode} % % \subsection{Post-processing TFM table} @@ -604,7 +601,7 @@ local function def_font(...) if type(fontdata) == "table" and fontdata.shared then % \end{macrocode} % -% Then we populate \texttt{MathConstants} table, which is required for +% Then we populate |MathConstants| table, which is required for % OpenType math. % % \begin{macrocode} @@ -663,19 +660,19 @@ end % Finally we register the callbacks % % \begin{macrocode} -luatexbase.add_to_callback('pre_linebreak_filter', +luatexbase.add_to_callback("pre_linebreak_filter", nodes.simple_font_handler, - 'luaotfload.pre_linebreak_filter') -luatexbase.add_to_callback('hpack_filter', + "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', + "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', + "luaotfload.define_font", 1) +luatexbase.add_to_callback("find_vf_file", fonts.vf.find, - 'luaotfload.find_vf_file') + "luaotfload.find_vf_file") % \end{macrocode} % % \iffalse -- cgit v1.2.3 From d1d0618258ee20da2800fb04de5512b0e4fe8646 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 25 Feb 2011 18:37:52 +0200 Subject: Fix bugs resulted from previous code removal --- luaotfload.dtx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 0308865..40f3a7c 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -605,6 +605,7 @@ local function def_font(...) % OpenType math. % % \begin{macrocode} + local otfdata = fontdata.shared.otfdata if otfdata.metadata.math then local mc = { } for k,v in next, otfdata.metadata.math do @@ -612,12 +613,12 @@ local function def_font(...) -- keep percent values as is mc[k] = v else - mc[k] = v / units * size + mc[k] = v / fontdata.units * fontdata.size end end -- for \overwithdelims - mc.FractionDelimiterSize = 1.01 * size - mc.FractionDelimiterDisplayStyleSize = 2.39 * size + mc.FractionDelimiterSize = 1.01 * fontdata.size + mc.FractionDelimiterDisplayStyleSize = 2.39 * fontdata.size fontdata.MathConstants = mc end -- cgit v1.2.3 From 407e7c71360163d970ab097982959066804d8c8d Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 28 Feb 2011 01:53:50 +0200 Subject: Simplify feature file --- tests/opbd.fea | 83 +++++++++------------------------------------------------- 1 file changed, 13 insertions(+), 70 deletions(-) diff --git a/tests/opbd.fea b/tests/opbd.fea index affc3c5..54f687a 100644 --- a/tests/opbd.fea +++ b/tests/opbd.fea @@ -1,5 +1,15 @@ +languagesystem DFLT dlft; +languagesystem grek dflt; +languagesystem latn dflt; +languagesystem latn AZE; +languagesystem latn CRT; +languagesystem latn MOL; +languagesystem latn NLD; +languagesystem latn PLK; +languagesystem latn ROM; +languagesystem latn TRK; -lookup RightBounds { +feature rtbd { lookupflag 0; pos \exclam <100 0 0 0>; pos \percent <100 0 0 0>; @@ -98,9 +108,9 @@ lookup RightBounds { pos \L_uni0303 <50 0 0 0>; pos \T_uni0303 <50 0 0 0>; pos \T_uni0308 <50 0 0 0>; -} RightBounds; +} rtbd; -lookup LeftBounds { +feature lfbd { lookupflag 0; pos \percent <-100 0 -100 0>; pos \ampersand <-50 0 -50 0>; @@ -174,71 +184,4 @@ lookup LeftBounds { pos \J_uni030C.cap <-50 0 -50 0>; pos \T_uni0303 <-50 0 -50 0>; pos \T_uni0308 <-50 0 -50 0>; -} LeftBounds; - -feature rtbd { - - script DFLT; - language dflt ; - lookup RightBounds; - - script grek; - language dflt ; - lookup RightBounds; - - script latn; - language dflt ; - lookup RightBounds; - language AZE exclude_dflt; - lookup RightBounds; - language CRT exclude_dflt; - lookup RightBounds; - language MOL exclude_dflt; - lookup RightBounds; - language NLD exclude_dflt; - lookup RightBounds; - language PLK exclude_dflt; - lookup RightBounds; - language ROM exclude_dflt; - lookup RightBounds; - language TRK exclude_dflt; - lookup RightBounds; - - script thai; - language dflt ; - lookup RightBounds; -} rtbd; - -feature lfbd { - - script DFLT; - language dflt ; - lookup LeftBounds; - - script grek; - language dflt ; - lookup LeftBounds; - - script latn; - language dflt ; - lookup LeftBounds; - language AZE exclude_dflt; - lookup LeftBounds; - language CRT exclude_dflt; - lookup LeftBounds; - language MOL exclude_dflt; - lookup LeftBounds; - language NLD exclude_dflt; - lookup LeftBounds; - language PLK exclude_dflt; - lookup LeftBounds; - language ROM exclude_dflt; - lookup LeftBounds; - language TRK exclude_dflt; - lookup LeftBounds; - - script thai; - language dflt ; - lookup LeftBounds; } lfbd; - -- cgit v1.2.3 From b819f1243cb0d9c8d95a7b1a66edd844ebc53964 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 28 Feb 2011 01:58:58 +0200 Subject: Minor --- tests/opbd.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/opbd.tex b/tests/opbd.tex index 4c45781..50c4dfd 100644 --- a/tests/opbd.tex +++ b/tests/opbd.tex @@ -2,7 +2,7 @@ \pdfprotrudechars2 \pdfadjustspacing2 -\font\testa=file:texgyrepagella-regular:script=latn at 12pt +\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 -- cgit v1.2.3 From 72785d1210ecae852eb1d84a4dddc44c878b771c Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 1 Mar 2011 18:23:24 +0200 Subject: Make it more clear what kind of features are supported --- luaotfload.dtx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 40f3a7c..ceb1c40 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -254,16 +254,15 @@ and the derived files % The supported keys are: % \begin{description} % \item [mode] \hfill \\ -% \textsf{luaotfload} has two OpenType processing modes; |base| and -% |node|. |base| mode works mapping those features to traditional -% \tex ligature and kerning mechanisms and thus supports only a subset of -% OpenType features but is a bit faster and is the only processing mode -% supports in math mode. |node| works by direct processing of the node -% list at Lua end and have more wide support of OpenType features but is a bit -% slower. -% -% By default |node| mode is used, and you have to manually force -% |base| mode when needed e.g. for math fonts. +% \textsf{luaotfload} has two OpenType processing modes; |base| and |node|. +% |base| mode works by mapping OpenType features to traditional \tex ligature +% and kerning mechanisms, thus supporting only non-contextual substitutions and +% kerning pairs, but is slightly faster. |node| works by direct processing of +% the node list at Lua end and have more wide support of OpenType features but +% can be slow especially with complex fonts and can't be used in math mode. +% +% By default |node| mode is used, and you have to manually force |base| mode +% when needed e.g. for math fonts. % % \item [script] \hfill \\ % OpenType script string, default value is |dflt|. Some fonts don't assign -- cgit v1.2.3 From d28c0319199de3faeca105e0a2d142c782b79dac Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 1 Mar 2011 18:41:50 +0200 Subject: Eat our own dog food --- Makefile | 8 ++++---- luaotfload.dtx | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ddf2f45..c649875 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ TDS_ZIP = $(NAME).tds.zip ZIPS = $(CTAN_ZIP) $(TDS_ZIP) DO_TEX = tex --interaction=batchmode $< >/dev/null -DO_PDFLATEX = pdflatex --interaction=batchmode $< >/dev/null +DO_LATEX = lualatex --interaction=batchmode $< >/dev/null DO_MAKEINDEX = makeindex -s gind.ist $(subst .dtx,,$<) >/dev/null 2>&1 all: $(GENERATED) @@ -52,10 +52,10 @@ tds: $(TDS_ZIP) world: all ctan $(COMPILED): $(DTX) - $(DO_PDFLATEX) + $(DO_LATEX) $(DO_MAKEINDEX) - $(DO_PDFLATEX) - $(DO_PDFLATEX) + $(DO_LATEX) + $(DO_LATEX) $(UNPACKED): $(DTX) $(DO_TEX) diff --git a/luaotfload.dtx b/luaotfload.dtx index ceb1c40..5d15898 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -107,8 +107,6 @@ and the derived files [2011/02/16 v1.24 OpenType layout system]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xcolor,xspace} -\usepackage{lmodern} -\usepackage{charter} \usepackage[ bookmarks=true, colorlinks=true, @@ -121,6 +119,10 @@ and the derived files pdfkeywords={luatex, lualatex, unicode, opentype} ]{hyperref} +\usepackage{fontspec} +\setmainfont[Ligatures=TeX]{Linux Libertine O} +\setsansfont[Ligatures=TeX]{Linux Biolinum O} + \definecolor{niceblue}{rgb}{0.4,0.6,1.000} \newcommand\tex {\TeX\xspace} -- cgit v1.2.3 From 6d3e20989335d2d6e3db6a85cc7f9a64b95e45a5 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 1 Mar 2011 18:44:00 +0200 Subject: A hack to get libertine's bold recognised --- otfl-font-nms.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index d32f22f..0e4bbda 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -74,8 +74,9 @@ local function load_names() return data end -local synonyms = { +local synonyms = { regular = { "normal", "roman", "plain", "book", "medium" }, + bold = { "boldregular" }, italic = { "regularitalic", "normalitalic", "oblique", "slant" }, bolditalic = { "boldoblique", "boldslat" }, } -- cgit v1.2.3 From 46c1e98709269fef4a4eeb0a5df93faf34957300 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 1 Mar 2011 18:48:55 +0200 Subject: Remove outdated comment --- luaotfload.dtx | 3 --- 1 file changed, 3 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 5d15898..412623e 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -437,9 +437,6 @@ and the derived files % % |\font\myfont = MyFont.otf:script=latn;+liga;| % -% Also remember to set |mode=node| as most OpenType features -% (such as contextual substitution, |calt|), will not work without it. -% % \part{\texttt{luaotfload.lua}} % % \iffalse -- cgit v1.2.3 From 356c608fc7f4c238298e91a455a7c42ec86ebff9 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 1 Mar 2011 18:53:31 +0200 Subject: Even more own dog food eating --- luaotfload.dtx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/luaotfload.dtx b/luaotfload.dtx index 412623e..586b8be 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -120,8 +120,10 @@ and the derived files ]{hyperref} \usepackage{fontspec} +\usepackage{unicode-math} \setmainfont[Ligatures=TeX]{Linux Libertine O} \setsansfont[Ligatures=TeX]{Linux Biolinum O} +\setmathfont{XITS Math} \definecolor{niceblue}{rgb}{0.4,0.6,1.000} -- cgit v1.2.3 From cbd70917db8df40c98fd63f1f4c02adbd76823d5 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 2 Mar 2011 10:38:32 +0200 Subject: Don't load the cached font if the feature file was changed Just a hack but seems to work until I check with Hans. --- otfl-font-otf.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/otfl-font-otf.lua b/otfl-font-otf.lua index d1ad3d0..fe9cd51 100644 --- a/otfl-font-otf.lua +++ b/otfl-font-otf.lua @@ -225,7 +225,9 @@ function otf.load(filename,format,sub,featurefile) local attr = lfs.attributes(filename) local size, time = attr.size or 0, attr.modification or 0 if featurefile then - name = name .. "@" .. file.removesuffix(file.basename(featurefile)) + local fattr = lfs.attributes(featurefile) + local fsize, ftime = fattr and fattr.size or 0, fattr and fattr.modification or 0 + name = name .. "@" .. file.removesuffix(file.basename(featurefile)) .. ftime .. fsize end if sub == "" then sub = false end local hash = name -- cgit v1.2.3 From 8151f93bac4474b23b51e941ab69b9a817daf82c Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 2 Mar 2011 10:41:33 +0200 Subject: Simplify --- tests/tkrn.fea | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/tkrn.fea b/tests/tkrn.fea index 30fc11f..c83927d 100644 --- a/tests/tkrn.fea +++ b/tests/tkrn.fea @@ -1,16 +1,8 @@ +languagesystem DFLT dflt; +languagesystem latn dflt; -lookup TeXkern { +feature tkrn { lookupflag 0; pos E X -125; pos T <0 0 -166 0> E <0 -235 0 0>; -} TeXkern; - -feature tkrn { - script DFLT; - language dflt ; - lookup TeXkern; - script latn; - language dflt ; - lookup TeXkern; - } tkrn; -- cgit v1.2.3