From e204300571bb3c539cacfd5e142ebd0f66c7309a Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 9 Apr 2013 15:31:48 +0200 Subject: Fixing issue #52 --- mkluatexfontdb.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkluatexfontdb.lua b/mkluatexfontdb.lua index 38b9daa..3854840 100755 --- a/mkluatexfontdb.lua +++ b/mkluatexfontdb.lua @@ -44,7 +44,7 @@ Valid options: -V --version print version and exit -h --help print this message -The output database file is named otfl-fonts.lua and is placed under: +The output database file is named otfl-names(.lua and .luc) and is placed under: %s" ]], name, names.path.dir)) -- cgit v1.2.3 From d9475ae1ca5d90213f195ded7c55457a3fe9ca05 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 9 Apr 2013 15:33:12 +0200 Subject: Fixing issue #49 --- mkluatexfontdb.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkluatexfontdb.lua b/mkluatexfontdb.lua index 3854840..2a25b29 100755 --- a/mkluatexfontdb.lua +++ b/mkluatexfontdb.lua @@ -46,7 +46,7 @@ Valid options: The output database file is named otfl-names(.lua and .luc) and is placed under: - %s" + %s ]], name, names.path.dir)) end -- cgit v1.2.3 From e67643a60422ed265dc5ad8955a83140598385f1 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 9 Apr 2013 16:56:50 +0200 Subject: Adapting to Lua 5.2 --- otfl-basics-gen.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/otfl-basics-gen.lua b/otfl-basics-gen.lua index bfd81fd..9a328d0 100644 --- a/otfl-basics-gen.lua +++ b/otfl-basics-gen.lua @@ -254,7 +254,8 @@ function caches.compile(data,luaname,lucname) if d and d ~= "" then local f = io.open(lucname,'w') if f then - local s = loadstring(d) + local s + if _G["loadstring"] then s=loadstring(d) else s=load(d) end f:write(string.dump(s)) f:close() end -- cgit v1.2.3 From f10aeb6e760a349986570489b838ae6384291107 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 10:31:44 +0200 Subject: Finishing to fix reference loop --- otfl-font-nms.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index c987c3a..ee9fa33 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -888,7 +888,9 @@ read_fonts_conf = function (path, results, passed_paths) read_fonts_conf(include, results, passed_paths) elseif lfs.isdir(include) then for _,f in next, dirglob(filejoin(include, "*.conf")) do - read_fonts_conf(f, results, passed_paths) + if not passed_paths_set[f] then + read_fonts_conf(f, results, passed_paths) + end end end end -- cgit v1.2.3 From 089dcf6f5742452ceb007f6d712cc925b7178f70 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 11:33:35 +0200 Subject: First try of a NEWS file for the new version --- NEWS | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/NEWS b/NEWS index 42e6e14..754cbcd 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,23 @@ Change History -------------- +2013/04/xx, luaotfload v2.2: + * Synchronisation with ConTeXt from TeXLive 2013, inducing + backward-incompatible changes in the font structure (fontspec and + unicode-math must be updated) + * Synchronisation with ConTeXt is now easier and can be done by just + updating otfl-fonts-merged.lua (available in ConTeXt) + * Improve documentation + * renaming mkluatexfontdb into fontdbutil, with more search functionalities + +2013/04/11, luaotfload v1.28: + * Adapting to LuaTeX 0.75, keeping backward-compatibility + * Fix small documentation issues in mkluatexfontdb + * Fix possibility of infite loop with fontconfig config files references + * Adding semibold synonym for bold + * file:xxx syntax now uses the same search function as name: which + make more fonts recognized + 2011/04/21, luaotfload v1.25: * Fix bug loading *.dfont fonts * Misc. documentation fixes -- cgit v1.2.3 From bd7ed57ad9f8cfc9e7a7dae148d567833f463278 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 18:16:04 +0200 Subject: Not versioning the generated files (a bit confusing) --- luaotfload.lua | 411 --------------------------------------------------------- luaotfload.sty | 34 ----- 2 files changed, 445 deletions(-) delete mode 100644 luaotfload.lua delete mode 100644 luaotfload.sty diff --git a/luaotfload.lua b/luaotfload.lua deleted file mode 100644 index 256c792..0000000 --- a/luaotfload.lua +++ /dev/null @@ -1,411 +0,0 @@ -module("luaotfload", package.seeall) - -luaotfload.module = { - name = "luaotfload", - version = 2.2, - date = "2013/04/15", - description = "OpenType layout system.", - author = "Elie Roux & Hans Hagen", - copyright = "Elie Roux", - license = "CC0" -} - -local luatexbase = luatexbase - -local type, next = type, next -local stringfind = string.find -local stringsub = string.sub -local stringmatch = string.match -local find_file = kpse.find_file - -local add_to_callback, create_callback = - luatexbase.add_to_callback, luatexbase.create_callback -local reset_callback, call_callback = - luatexbase.reset_callback, luatexbase.call_callback - -local dummy_function = function () end - ---[[doc-- -No final decision has been made on how to handle font definition. At -the moment, there are three candidates: The \identifier{generic} -callback as hard-coded in the font loader, the \identifier{old} -wrapper, and a simplified version of the latter (\identifier{patch}) -that does nothing besides applying font patches. ---doc]]-- -luaotfload.font_definer = "patch" --- | “generic” | “old” - -local error, warning, info, log = - luatexbase.provides_module(luaotfload.module) - ---[[doc-- -This is a necessary initalization in order not to rebuild an existing -font. -Maybe 600 should be replaced by \texmacro{pdfpkresolution} %% (why?) -or \luafunction{texconfig.pk_dpi} (and it should be replaced -dynamically), but we don't have access (yet) to the -\identifier{texconfig} table, so we let it be 600. -Anyway, it does still work fine even if \texmacro{pdfpkresolution} is -changed. ---doc]]-- - -kpse.init_prog("", 600, "/") - ---[[doc-- -We set the minimum version requirement for \LUATEX to v0.74, as it was -the first version to include version 5.2 of the \LUA interpreter. ---doc]]-- - -local luatex_version = 74 - -if tex.luatexversion < luatex_version then - warning("LuaTeX v%.2f is old, v%.2f is recommended.", - tex.luatexversion/100, - luatex_version /100) -end - ---[[doc-- -\subsection{Module loading} - -We load the files imported from \CONTEXT with this function. -It automatically prepends the prefix \fileent{otfl-} to its argument, -so we can refer to the files with their actual \CONTEXT name. ---doc]]-- - -local fl_prefix = "otfl" -- “luatex” for luatex-plain -local loadmodule = function (name) - local tofind = fl_prefix .."-"..name - local found = find_file(tofind,"tex") - if found then - log("loading file %s.", found) - dofile(found) - else - error("file %s not found.", tofind) - end -end - ---[[doc-- -Virtual fonts are resolved via a callback. -\luafunction{find_vf_file} derives the name of the virtual font file -from the filename. -(NB: \CONTEXT handles this likewise in \fileent{font-vf.lua}.) ---doc]]-- -local Cs, P, lpegmatch = lpeg.Cs, lpeg.P, lpeg.match - -local p_dot, p_slash = P".", P"/" -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") - if not fullname then - --fullname = find_file(file.removesuffix(name), "ovf") - fullname = find_file(lpegmatch(p_removesuffix, name), "ovf") - end - if fullname then - log("loading virtual font file %s.", fullname) - end - return fullname -end - ---[[doc-- - -\subsection{Preparing the Font Loader} -We treat the fontloader as a black box so behavior is consistent -between formats. -The wrapper file is \fileent{otfl-fonts.lua} which we imported from -\href{http://standalone.contextgarden.net/current/context/experimental/tex/generic/context/luatex/}{\LUATEX-Plain}. -It has roughly two purposes: - -\begin{enumerate} - - \item insert the functionality required for fontloader; and - - \item put it in place via the respective callbacks. - -\end{enumerate} - -How the first step is executed depends on the presence on the -\emphasis{merged font loader code}. -In \identifier{luaotfload} this is contained in the file -\fileent{otfl-fonts-merged.lua}. -If this file cannot be found, the original libraries from \CONTEXT of -which the merged code was composed are loaded instead. - -Hans provides two global tables to control the font loader: - - \begin{itemize} - \item \luafunction{generic_context}: - encapsulation mechanism, callback functions - \item \luafunction{non generic_context}: - customized code insertion - \end{itemize} - - -With \luafunction{non_generic_context} we can tailor the font loader -insertion to our file naming habits (key \luafunction{load_before}). -Additionally, \luafunction{skip_loading} can be unset to force loading -of the original libraries as though the merged code was absent. -Another key, \luafunction{load_after} is called at the time when the -font loader is actually inserted. -In combination with the option \luafunction{no_callbacks_yet} in -\luafunction{generic_context}, we can insert our own, -\identifier{luatexbase}-style callback handling here. ---doc]]-- -if not _G. generic_context then _G. generic_context = { } end -if not _G.non_generic_context then _G.non_generic_context = { } end - -local generic_context = generic_context -local non_generic_context =non_generic_context - -generic_context.no_callbacks_yet = true - -_G.non_generic_context = { luatex_fonts = { - load_before = "otfl-fonts-merged.lua", - -- load_after = nil, --- TODO, this is meant for callbacks - skip_loading = true, -}} - ---[[doc-- -The imported font loader will call \luafunction{callback.register} once -while reading \fileent{font-def.lua}. -This is unavoidable unless we modify the imported files, but harmless -if we make it call a dummy instead. ---doc]]-- - -local trapped_register = callback.register -callback.register = dummy_function - ---[[doc-- -Now that things are sorted out we can finally load the fontloader. ---doc]]-- - -loadmodule"fonts.lua" - ---[[doc-- -By default, the fontloader requires a number of \emphasis{private -attributes} for internal use. -These must be kept consistent with the attribute handling methods as -provided by \identifier{luatexbase}. -Our strategy is to override the function that allocates new attributes -before we initialize the font loader, making it a wrapper around -\luafunction{luatexbase.new_attribute}.\footnote{% - Many thanks, again, to Hans Hagen for making this part - configurable! -} -The attribute identifiers are prefixed “\fileent{otfl@}” to -avoid name clashes. ---doc]]-- - -do - local new_attribute = luatexbase.new_attribute - local the_attributes = luatexbase.attributes - - _G.attributes = _G.attributes or { } - - _G.attributes.private = function (name) - local attr = "otfl@" .. name - local number = the_attributes[attr] - if not number then - number = new_attribute(attr) - end - return number - end -end - ---[[doc-- - -\subsection{Callbacks} - -After the fontloader is ready we can restore the callback trap from -\identifier{luatexbase}. ---doc]]-- - -callback.register = trapped_register - ---[[doc-- -We do our own callback handling with the means provided by luatexbase. - -Note: \luafunction{pre_linebreak_filter} and \luafunction{hpack_filter} -are coupled in \CONTEXT in the concept of \emphasis{node processor}. ---doc]]-- - -add_to_callback("pre_linebreak_filter", - generic_context.callback_pre_linebreak_filter, - "luaotfload.node_processor", - 1) -add_to_callback("hpack_filter", - generic_context.callback_hpack_filter, - "luaotfload.node_processor", - 1) -add_to_callback("find_vf_file", - find_vf_file, "luaotfload.find_vf_file") - -loadmodule"font-otc.lua" -- TODO check what we can drop from otfl-features -loadmodule"lib-dir.lua" -- required by font-nms -loadmodule"luat-ovr.lua" - -if fonts and fonts.readers.tfm then - -------------------------------------------------------------------- - --- OFM; read this first - -------------------------------------------------------------------- - --- I can’t quite make out whether this is still relevant - --- as those ofm fonts always fail, even in the 2011 version - --- (mktexpk: don't know how to create bitmap font for omarabb.ofm) - --- the font loader appears to read ofm like tfm so if this - --- hack was supposed achieve that, we should excise it anyways - fonts.readers.ofm = fonts.readers.tfm - fonts.handlers.ofm = fonts.handlers.tfm --- empty anyways - fonts.formats.ofm = fonts.formats.tfm --- “type1” - --- fonts.readers.sequence[#fonts.readers.sequence+1] = "ofm" - -------------------------------------------------------------------- -end - ---[[doc-- - -Now we load the modules written for \identifier{luaotfload}. - ---doc]]-- -loadmodule"font-pfb.lua" --- new in 2.0, added 2011 -loadmodule"font-nms.lua" -loadmodule"font-clr.lua" -loadmodule"font-ltx.lua" --- new in 2.0, added 2011 - ---[[doc-- - -We create a callback for patching fonts on the fly, to be used by other -packages. -It initially contains the empty function that we are going to override -below. - ---doc]]-- - -create_callback("luaotfload.patch_font", "simple", dummy_function) - ---[[doc-- - -This is a wrapper for the imported font loader. -As of 2013, everything it does appear to be redundand, so we won’t use -it unless somebody points out a cogent reason. -Nevertheless, it has been adapted to work with the current structure of -font data objects and will stay here for reference / until breakage is -reported. - -\emphasis{TODO} -This one also enables patching fonts. -The current fontloader apparently comes with a dedicated mechanism for -that already: enhancers. -How those work remains to be figured out. - ---doc]]-- -local define_font_wrapper = function (...) - --- we use “tfmdata” (not “fontdata”) for consistency with the - --- font loader - local tfmdata = fonts.definers.read(...) - if type(tfmdata) == "table" and tfmdata.shared then - local metadata = tfmdata.shared.rawdata.metadata - local mathdata = metadata.math --- do all fonts have this field? - if mathdata then - local mathconstants = { } --- why new hash, not modify in place? - local units_per_em = metadata.units_per_em - local size = tfmdata.size - for k,v in next, mathdata do - --- afaics this is alread taken care of by - --- definers.read - if stringfind(k, "Percent") then - -- keep percent values as is - print(k,v) - mathconstants[k] = v - else - mathconstants[k] = v / units_per_em * size - end - end - --- for \overwithdelims - --- done by definers.read as well - mathconstants.FractionDelimiterSize = 1.01 * size - --- fontloader has 2.4 × size - mathconstants.FractionDelimiterDisplayStyleSize = 2.39 * size - tfmdata.MathConstants = mathconstants - end - call_callback("luaotfload.patch_font", tfmdata) - end - return tfmdata -end - ---[[doc-- - -\subsection{\CONTEXT override} - -We provide a simplified version of the original font definition -callback. - ---doc]]-- - -local read_font_file = fonts.definers.read -local patch_defined_font = function (...) - local tfmdata = read_font_file(...)-- spec -> size -> id -> tmfdata - if type(tfmdata) == "table" then - call_callback("luaotfload.patch_font", tfmdata) - end - return tfmdata -end - -caches.compilemethod = "both" - -reset_callback("define_font") - ---[[doc-- -Finally we register the callbacks ---doc]]-- - -if luaotfload.font_definer == "old" then - add_to_callback("define_font", - define_font_wrapper, - "luaotfload.define_font", - 1) -elseif luaotfload.font_definer == "generic" then - add_to_callback("define_font", - generic_context.callback_define_font, - "luaotfload.define_font", - 1) -elseif luaotfload.font_definer == "patch" then - add_to_callback("define_font", - patch_defined_font, - "luaotfload.define_font", - 1) -end - ---[[todo-- ---- The manual promises coercion of the file: lookup if ---- the asked name is enclosed in brackets. ---- A couple things make me doubt that this is the case: ---- ---- 1) there doesn’t appear to be code for these cases ---- 2) the brackets remain part of the file name ---- 3) we still get calls to names.resolve which ---- ignores the “lookup” field of the spec it gets ---- ---- For this reason here is some code that a) coerces ---- file: lookups in these cases and b) strips the brackets ---- from the file name. As we *still* get name: lookups even ---- though this code is active I’ll just leave it here ---- for reference, ineffective as it is. -do - local getspecification, makespecification = - fonts.definers.getspecification, fonts.definers.makespecification - - local analyze = function (specification, size) - local lookup, name, sub, method, detail = getspecification(specification or "") - local filename = stringmatch(name, "^%[(.*)%]$") - if filename then - lookup = "file" --> coerce file: - name = filename --> remove brackets - end - return makespecification(specification, lookup, name, sub, method, detail, size) - end - fonts.definers.analyze = analyze -end ---]]-- - -loadmodule"features.lua" - --- vim:tw=71:sw=4:ts=4:expandtab diff --git a/luaotfload.sty b/luaotfload.sty deleted file mode 100644 index 4d566af..0000000 --- a/luaotfload.sty +++ /dev/null @@ -1,34 +0,0 @@ -%% -%% This is file `luaotfload.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% luaotfload.dtx (with options: `package') -%% This is a generated file. -%% -%% Copyright (C) 2009-2011 by by Elie Roux -%% and Khaled Hosny -%% (Support: .) -%% -%% This work is under the CC0 license. -%% -%% This work consists of the main source file luaotfload.dtx -%% and the derived files -%% luaotfload.sty, luaotfload.lua -%% -\csname ifluaotfloadloaded\endcsname -\let\ifluaotfloadloaded\endinput -\bgroup\expandafter\expandafter\expandafter\egroup -\expandafter\ifx\csname ProvidesPackage\endcsname\relax - \input luatexbase.sty -\else - \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luaotfload}% - [2011/10/06 v2.0 OpenType layout system] - \RequirePackage{luatexbase} -\fi -\RequireLuaModule{luaotfload} -\endinput -%% -%% End of file `luaotfload.sty'. -- cgit v1.2.3 From e8fe5e1e830658776413eb5e8af450ff4ae93ec7 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 18:17:28 +0200 Subject: A more simple loadmodule function Simply using the luatexbase way... May change in the future, but stick with it for now. --- luaotfload.dtx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 818dbd9..8ffb8f9 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -905,14 +905,7 @@ end local fl_prefix = "otfl" -- “luatex” for luatex-plain local loadmodule = function (name) - local tofind = fl_prefix .."-"..name - local found = find_file(tofind,"tex") - if found then - log("loading file %s.", found) - dofile(found) - else - error("file %s not found.", tofind) - end + require(fl_prefix .."-"..name) end % \end{macrocode} -- cgit v1.2.3 From 4a13ae53c8441c1fba6d059f44f364cc7cdaa673 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 18:29:23 +0200 Subject: Documenting and simplifying ofm font bug handling --- luaotfload.dtx | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 8ffb8f9..03b63c1 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -910,10 +910,12 @@ end % \end{macrocode} % -% Virtual fonts are resolved via a callback. -% \luafunction{find_vf_file} derives the name of the virtual font file -% from the filename. -% (NB: \CONTEXT handles this likewise in \fileent{font-vf.lua}.) +% Before \TeX Live 2013 version, \LUATEX had a bug that made ofm fonts fail +% when called with their extension. There was a side-effect making ofm +% totally unloadable when luaotfload was present. The following lines are +% a patch for this bug. The utility of these lines is questionable as they +% are not necessary since \TeX Live 2013. They should be removed in the next +% version. % % \begin{macrocode} local Cs, P, lpegmatch = lpeg.Cs, lpeg.P, lpeg.match @@ -1120,22 +1122,19 @@ loadmodule"font-otc.lua" -- TODO check what we can drop from otfl-features loadmodule"lib-dir.lua" -- required by font-nms loadmodule"luat-ovr.lua" -if fonts and fonts.readers.tfm then - -------------------------------------------------------------------- - --- OFM; read this first - -------------------------------------------------------------------- - --- I can’t quite make out whether this is still relevant - --- as those ofm fonts always fail, even in the 2011 version - --- (mktexpk: don't know how to create bitmap font for omarabb.ofm) - --- the font loader appears to read ofm like tfm so if this - --- hack was supposed achieve that, we should excise it anyways - fonts.readers.ofm = fonts.readers.tfm - fonts.handlers.ofm = fonts.handlers.tfm --- empty anyways - fonts.formats.ofm = fonts.formats.tfm --- “type1” - --- fonts.readers.sequence[#fonts.readers.sequence+1] = "ofm" - -------------------------------------------------------------------- -end - +% \end{macrocode} +% +% +% \CONTEXT does not support ofm, these lines were added in order to make it +% work. However they do not seem necessary so they are commented for now. +% +% \begin{macrocode} +-- if fonts and fonts.readers.tfm then +-- fonts.readers.ofm = fonts.readers.tfm +-- fonts.handlers.ofm = fonts.handlers.tfm --- empty anyways +-- fonts.formats.ofm = fonts.formats.tfm --- “type1” +-- --- fonts.readers.sequence[#fonts.readers.sequence+1] = "ofm" +--end % \end{macrocode} % % -- cgit v1.2.3 From 3a59b8b6b226ed22ccd16aec2dc2e272f015cc74 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 18:38:10 +0200 Subject: Less verbose output - first step Is it possible to adapt something like this in the ConTeXt files? --- otfl-fonts.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/otfl-fonts.lua b/otfl-fonts.lua index 75bd079..7e32465 100644 --- a/otfl-fonts.lua +++ b/otfl-fonts.lua @@ -37,10 +37,12 @@ if not generic_context then generic_context = { } end +local printinfo = function(s) texio.write_nl("log", s) end + if not generic_context.push_namespaces then function generic_context.push_namespaces() - texio.write(" ") + printinfo(" ") local normalglobal = { } for k, v in next, _G do normalglobal[k] = v @@ -50,7 +52,7 @@ if not generic_context.push_namespaces then function generic_context.pop_namespaces(normalglobal,isolate) if normalglobal then - texio.write(" ") + printinfo(" ") for k, v in next, _G do if not normalglobal[k] then generic_context[k] = v @@ -110,7 +112,7 @@ local function loadmodule(name,continue) end else if verbose then - texio.write(string.format(" <%s>",foundname)) -- no file.basename yet + printinfo(string.format(" <%s>",foundname)) -- no file.basename yet end dofile(foundname) end @@ -252,6 +254,6 @@ end -- We're done. -texio.write(string.format(" ", os.gettimeofday()-starttime)) +--texio.write(string.format(" ", os.gettimeofday()-starttime)) generic_context.pop_namespaces(whatever) -- cgit v1.2.3 From c80fad6066b1ab0ad40ef13d50945c2d3578694a Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 18:55:33 +0200 Subject: basics-gen seems to be already present in the merged file --- otfl-basics-gen.lua | 296 ---------------------------------------------------- 1 file changed, 296 deletions(-) delete mode 100644 otfl-basics-gen.lua diff --git a/otfl-basics-gen.lua b/otfl-basics-gen.lua deleted file mode 100644 index 727086e..0000000 --- a/otfl-basics-gen.lua +++ /dev/null @@ -1,296 +0,0 @@ -if not modules then modules = { } end modules ['luat-basics-gen'] = { - version = 1.100, - comment = "companion to luatex-*.tex", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -if context then - texio.write_nl("fatal error: this module is not for context") - os.exit() -end - -local dummyfunction = function() end ------ dummyreporter = function(c) return function(...) texio.write_nl(c .. " : " .. string.format(...)) end end -local dummyreporter = function(c) return function(...) texio.write_nl(c .. " : " .. string.formatters(...)) end end - -statistics = { - register = dummyfunction, - starttiming = dummyfunction, - stoptiming = dummyfunction, - elapsedtime = nil, -} - -directives = { - register = dummyfunction, - enable = dummyfunction, - disable = dummyfunction, -} - -trackers = { - register = dummyfunction, - enable = dummyfunction, - disable = dummyfunction, -} - -experiments = { - register = dummyfunction, - enable = dummyfunction, - disable = dummyfunction, -} - -storage = { -- probably no longer needed - register = dummyfunction, - shared = { }, -} - -logs = { - new = dummyreporter, - reporter = dummyreporter, - messenger = dummyreporter, - report = dummyfunction, -} - -callbacks = { - register = function(n,f) return callback.register(n,f) end, - -} - -utilities = { - storage = { - allocate = function(t) return t or { } end, - mark = function(t) return t or { } end, - }, -} - -characters = characters or { - data = { } -} - --- we need to cheat a bit here - -texconfig.kpse_init = true - -resolvers = resolvers or { } -- no fancy file helpers used - -local remapper = { - otf = "opentype fonts", - ttf = "truetype fonts", - ttc = "truetype fonts", - dfont = "truetype fonts", -- "truetype dictionary", - cid = "cid maps", - cidmap = "cid maps", - fea = "font feature files", - pfa = "type1 fonts", -- this is for Khaled, in ConTeXt we don't use this! - pfb = "type1 fonts", -- this is for Khaled, in ConTeXt we don't use this! -} - -function resolvers.findfile(name,fileformat) - name = string.gsub(name,"\\","/") - if not fileformat or fileformat == "" then - fileformat = file.suffix(name) - if fileformat == "" then - fileformat = "tex" - end - end - fileformat = string.lower(fileformat) - fileformat = remapper[fileformat] or fileformat - local found = kpse.find_file(name,fileformat) - if not found or found == "" then - found = kpse.find_file(name,"other text files") - end - return found -end - --- function resolvers.findbinfile(name,fileformat) --- if not fileformat or fileformat == "" then --- fileformat = file.suffix(name) --- end --- return resolvers.findfile(name,(fileformat and remapper[fileformat]) or fileformat) --- end - -resolvers.findbinfile = resolvers.findfile - -function resolvers.resolve(s) - return s -end - -function resolvers.unresolve(s) - return s -end - --- Caches ... I will make a real stupid version some day when I'm in the --- mood. After all, the generic code does not need the more advanced --- ConTeXt features. Cached data is not shared between ConTeXt and other --- usage as I don't want any dependency at all. Also, ConTeXt might have --- different needs and tricks added. - ---~ containers.usecache = true - -caches = { } - -local writable, readables = nil, { } - -if not caches.namespace or caches.namespace == "" or caches.namespace == "context" then - caches.namespace = 'generic' -end - -do - - local cachepaths = kpse.expand_path('$TEXMFCACHE') or "" - - if cachepaths == "" then - cachepaths = kpse.expand_path('$TEXMFVAR') - end - - if cachepaths == "" then - cachepaths = kpse.expand_path('$VARTEXMF') - end - - if cachepaths == "" then - cachepaths = "." - end - - cachepaths = string.split(cachepaths,os.type == "windows" and ";" or ":") - - for i=1,#cachepaths do - if file.is_writable(cachepaths[i]) then - writable = file.join(cachepaths[i],"luatex-cache") - lfs.mkdir(writable) - writable = file.join(writable,caches.namespace) - lfs.mkdir(writable) - break - end - end - - for i=1,#cachepaths do - if file.is_readable(cachepaths[i]) then - readables[#readables+1] = file.join(cachepaths[i],"luatex-cache",caches.namespace) - end - end - - if not writable then - texio.write_nl("quiting: fix your writable cache path") - os.exit() - elseif #readables == 0 then - texio.write_nl("quiting: fix your readable cache path") - os.exit() - elseif #readables == 1 and readables[1] == writable then - texio.write(string.format("(using cache: %s)",writable)) - else - texio.write(string.format("(using write cache: %s)",writable)) - texio.write(string.format("(using read cache: %s)",table.concat(readables, " "))) - end - -end - -function caches.getwritablepath(category,subcategory) - local path = file.join(writable,category) - lfs.mkdir(path) - path = file.join(path,subcategory) - lfs.mkdir(path) - return path -end - -function caches.getreadablepaths(category,subcategory) - local t = { } - for i=1,#readables do - t[i] = file.join(readables[i],category,subcategory) - end - return t -end - -local function makefullname(path,name) - if path and path ~= "" then - name = "temp-" .. name -- clash prevention - return file.addsuffix(file.join(path,name),"lua"), file.addsuffix(file.join(path,name),"luc") - end -end - -function caches.is_writable(path,name) - local fullname = makefullname(path,name) - return fullname and file.is_writable(fullname) -end - -function caches.loaddata(paths,name) - for i=1,#paths do - local data = false - local luaname, lucname = makefullname(paths[i],name) - if lucname and lfs.isfile(lucname) then -- maybe also check for size - texio.write(string.format("(load luc: %s)",lucname)) - data = loadfile(lucname) - if data then - data = data() - end - if data then - return data - else - texio.write(string.format("(loading failed: %s)",lucname)) - end - end - if luaname and lfs.isfile(luaname) then - texio.write(string.format("(load lua: %s)",luaname)) - data = loadfile(luaname) - if data then - data = data() - end - if data then - return data - end - end - end -end - -function caches.savedata(path,name,data) - local luaname, lucname = makefullname(path,name) - if luaname then - texio.write(string.format("(save: %s)",luaname)) - table.tofile(luaname,data,true,{ reduce = true }) - if lucname and type(caches.compile) == "function" then - os.remove(lucname) -- better be safe - texio.write(string.format("(save: %s)",lucname)) - caches.compile(data,luaname,lucname) - end - end -end - --- According to KH os.execute is not permitted in plain/latex so there is --- no reason to use the normal context way. So the method here is slightly --- different from the one we have in context. We also use different suffixes --- as we don't want any clashes (sharing cache files is not that handy as --- context moves on faster.) --- --- Beware: serialization might fail on large files (so maybe we should pcall --- this) in which case one should limit the method to luac and enable support --- for execution. - -caches.compilemethod = "both" - -function caches.compile(data,luaname,lucname) - local done = false - if caches.compilemethod == "luac" or caches.compilemethod == "both" then - done = os.spawn("texluac -o " .. string.quoted(lucname) .. " -s " .. string.quoted(luaname)) == 0 - end - if not done and (caches.compilemethod == "dump" or caches.compilemethod == "both") then - local d = io.loaddata(luaname) - if not d or d == "" then - d = table.serialize(data,true) -- slow - end - if d and d ~= "" then - local f = io.open(lucname,'w') - if f then - local s - if _G["loadstring"] then s=loadstring(d) else s=load(d) end - f:write(string.dump(s)) - f:close() - end - end - end -end - --- - -function table.setmetatableindex(t,f) - setmetatable(t,{ __index = f }) -end -- cgit v1.2.3 From 80e5042a10620dbb2c456cf5d3a472c66fe6a90f Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 19:04:49 +0200 Subject: Verbosity reduction step 2 This implies a modification in otfl-fonts-merged.lua that should be asked to Hans... --- luaotfload.dtx | 17 +++++++++++++++++ otfl-fonts-merged.lua | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 03b63c1..e36bb36 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -1045,6 +1045,23 @@ _G.non_generic_context = { luatex_fonts = { local trapped_register = callback.register callback.register = dummy_function +% \end{macrocode} +% +% In order to have an output with normal verbosity, we need to pre-override +% some \CONTEXT log function: +% +% \begin{macrocode} + +local dummylogfunction=function() end +local dummylogreporter=function(c) return function(...) log(string.formatters(...)) end end + +_G.logs={ + new=dummylogreporter, + reporter=dummylogreporter, + messenger=dummylogreporter, + report=dummylogfunction, +} + % \end{macrocode} % % Now that things are sorted out we can finally load the fontloader. diff --git a/otfl-fonts-merged.lua b/otfl-fonts-merged.lua index 44f42ed..19c8ce1 100644 --- a/otfl-fonts-merged.lua +++ b/otfl-fonts-merged.lua @@ -2926,7 +2926,7 @@ storage={ register=dummyfunction, shared={}, } -logs={ +logs=logs or { new=dummyreporter, reporter=dummyreporter, messenger=dummyreporter, -- cgit v1.2.3 From 89aaa92df44af21be14c32fa7425b1cfa0674820 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 20:59:22 +0200 Subject: Stop using module() in luaotfload.lua These _G are a bit ugly... --- luaotfload.dtx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index e36bb36..22afb45 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -822,7 +822,7 @@ and the derived files %<*lua> % \fi % \begin{macrocode} -module("luaotfload", package.seeall) +luaotfload = luaotfload or {} luaotfload.module = { name = "luaotfload", @@ -1019,15 +1019,9 @@ end % \identifier{luatexbase}-style callback handling here. % % \begin{macrocode} -if not _G. generic_context then _G. generic_context = { } end -if not _G.non_generic_context then _G.non_generic_context = { } end +generic_context = {no_callbacks_yet = true} -local generic_context = generic_context -local non_generic_context =non_generic_context - -generic_context.no_callbacks_yet = true - -_G.non_generic_context = { luatex_fonts = { +non_generic_context = { luatex_fonts = { load_before = "otfl-fonts-merged.lua", -- load_after = nil, --- TODO, this is meant for callbacks skip_loading = true, @@ -1055,7 +1049,7 @@ callback.register = dummy_function local dummylogfunction=function() end local dummylogreporter=function(c) return function(...) log(string.formatters(...)) end end -_G.logs={ +logs={ new=dummylogreporter, reporter=dummylogreporter, messenger=dummylogreporter, @@ -1091,9 +1085,9 @@ do local new_attribute = luatexbase.new_attribute local the_attributes = luatexbase.attributes - _G.attributes = _G.attributes or { } + attributes = attributes or { } - _G.attributes.private = function (name) + attributes.private = function (name) local attr = "otfl@" .. name local number = the_attributes[attr] if not number then -- cgit v1.2.3 From 8d1a301641504e6d7ff4194e01ab89bafba06486 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 21:03:49 +0200 Subject: Making test files independent from ConTeXt files --- tests/color.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/color.tex b/tests/color.tex index 1be8896..188889c 100644 --- a/tests/color.tex +++ b/tests/color.tex @@ -4,7 +4,7 @@ \font\testb=file:lmroman10-regular.otf:color=FFFF0099;+trep at 10pt \font\testc=file:lmroman10-regular.otf:color=559922;+trep at 12pt -\testa \input knuth \par -\testb \input knuth \par -\testc \input knuth \par +\testa FF0000BB \par +\testb FFFF0099 \par +\testc 559922 \par \bye -- cgit v1.2.3 From 5c273b8ac66cacbd8e68a272b0317bac442e1958 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Apr 2013 21:06:48 +0200 Subject: More tests independent from ConTeXt files --- tests/microtypography.tex | 31 +++++++++++++++++++++++++++++-- tests/opbd.tex | 30 ++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/tests/microtypography.tex b/tests/microtypography.tex index 7d032e3..f2d461d 100644 --- a/tests/microtypography.tex +++ b/tests/microtypography.tex @@ -4,6 +4,33 @@ \font\testa=file:texgyretermes-regular:script=latn at 12pt \font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt -\testa \input tufte \par -\testb \input tufte \par + +\testa We thrive in information||thick worlds because of our +marvelous and everyday capacity to select, edit, +single out, structure, highlight, group, pair, merge, +harmonize, synthesize, focus, organize, condense, +reduce, boil down, choose, categorize, catalog, classify, +list, abstract, scan, look into, idealize, isolate, +discriminate, distinguish, screen, pigeonhole, pick over, +sort, integrate, blend, inspect, filter, lump, skip, +smooth, chunk, average, approximate, cluster, aggregate, +outline, summarize, itemize, review, dip into, +flip through, browse, glance into, leaf through, skim, +refine, enumerate, glean, synopsize, winnow the wheat +from the chaff and separate the sheep from the goats.\par + +\testb We thrive in information||thick worlds because of our +marvelous and everyday capacity to select, edit, +single out, structure, highlight, group, pair, merge, +harmonize, synthesize, focus, organize, condense, +reduce, boil down, choose, categorize, catalog, classify, +list, abstract, scan, look into, idealize, isolate, +discriminate, distinguish, screen, pigeonhole, pick over, +sort, integrate, blend, inspect, filter, lump, skip, +smooth, chunk, average, approximate, cluster, aggregate, +outline, summarize, itemize, review, dip into, +flip through, browse, glance into, leaf through, skim, +refine, enumerate, glean, synopsize, winnow the wheat +from the chaff and separate the sheep from the goats.\par + \bye diff --git a/tests/opbd.tex b/tests/opbd.tex index 50c4dfd..3d26662 100644 --- a/tests/opbd.tex +++ b/tests/opbd.tex @@ -4,6 +4,32 @@ \font\testa=file:texgyrepagella-regular:script=latn at 12pt \font\testb=file:texgyrepagella-regular:mode=node;script=latn;protrusion=yes;featurefile=opbd.fea;+opbd at 12pt -\testa \input tufte \par -\testb \input tufte \par + +\testa We thrive in information||thick worlds because of our +marvelous and everyday capacity to select, edit, +single out, structure, highlight, group, pair, merge, +harmonize, synthesize, focus, organize, condense, +reduce, boil down, choose, categorize, catalog, classify, +list, abstract, scan, look into, idealize, isolate, +discriminate, distinguish, screen, pigeonhole, pick over, +sort, integrate, blend, inspect, filter, lump, skip, +smooth, chunk, average, approximate, cluster, aggregate, +outline, summarize, itemize, review, dip into, +flip through, browse, glance into, leaf through, skim, +refine, enumerate, glean, synopsize, winnow the wheat +from the chaff and separate the sheep from the goats.\par + +\testb We thrive in information||thick worlds because of our +marvelous and everyday capacity to select, edit, +single out, structure, highlight, group, pair, merge, +harmonize, synthesize, focus, organize, condense, +reduce, boil down, choose, categorize, catalog, classify, +list, abstract, scan, look into, idealize, isolate, +discriminate, distinguish, screen, pigeonhole, pick over, +sort, integrate, blend, inspect, filter, lump, skip, +smooth, chunk, average, approximate, cluster, aggregate, +outline, summarize, itemize, review, dip into, +flip through, browse, glance into, leaf through, skim, +refine, enumerate, glean, synopsize, winnow the wheat +from the chaff and separate the sheep from the goats.\par \bye -- cgit v1.2.3 From 267997e49570d3d08b4de3eb6c9c5394ec1d2f97 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 14:28:25 +0200 Subject: Making the file method resolve fonts with the database --- luaotfload.dtx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/luaotfload.dtx b/luaotfload.dtx index 22afb45..595a9fa 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -1157,6 +1157,20 @@ loadmodule"font-nms.lua" loadmodule"font-clr.lua" loadmodule"font-ltx.lua" --- new in 2.0, added 2011 +% \end{macrocode} +% +% +% This hack makes fonts called with file method found by fonts.names.resove +% instead of just trying to find them with kpse. It is necessary in case +% of fonts that are not accessible by kpse but present in the database, a +% quite common case under Linux. +% +% \begin{macrocode} + +fonts.definers.resolvers.file = function (specification) + specification.name = fonts.names.resolve('', '', specification) +end + % \end{macrocode} % % -- cgit v1.2.3 From 488d7fd86850691244709064777bc22113262701 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 14:31:15 +0200 Subject: Adding a little TODO for file lookup --- otfl-font-nms.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index ee9fa33..b62f5ec 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -243,6 +243,9 @@ font database created by the mkluatexfontdb script. --- successful lookup as this cannot be inferred from the other --- values. --- +--- TODO: this function is used also with the file lookup, it could be optimized +--- a lot for this case. +--- resolve = function (_,_,specification) -- the 1st two parameters are used by ConTeXt local name = sanitize_string(specification.name) local style = sanitize_string(specification.style) or "regular" -- cgit v1.2.3 From 0d3168d8b69d8eed835ff137cb24b6f83c2a28f6 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 16:19:46 +0200 Subject: As a matter of fact, there was nothing to optimize... --- otfl-font-nms.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index b62f5ec..e8ad626 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -243,8 +243,6 @@ font database created by the mkluatexfontdb script. --- successful lookup as this cannot be inferred from the other --- values. --- ---- TODO: this function is used also with the file lookup, it could be optimized ---- a lot for this case. --- resolve = function (_,_,specification) -- the 1st two parameters are used by ConTeXt local name = sanitize_string(specification.name) -- cgit v1.2.3 From b1e675cbd171400ccc7a41a092a668215a8d8343 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 16:29:53 +0200 Subject: Making make check work on my system I cannot actually understand what was all the ENV thing for... --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6606861..0a8770d 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,6 @@ TESTDIR = tests TESTFILES = $(wildcard $(TESTDIR)/*.tex) TESTFILES_SYS = $(TESTDIR)/systemfonts.tex $(TESTDIR)/fontconfig_conf_reading.tex TESTFILES_TL = $(filter-out $(TESTFILES_SYS), $(TESTFILES)) -TESTENV = env TEXINPUTS='.;..;$$TEXMF/tex/{luatex,plain,generic,}//' TEXMFVAR='../var' # Files grouped by installation location SCRIPTFILES = $(SCRIPT) @@ -95,9 +94,9 @@ install: $(ALL_FILES) check: $(RUNFILES) $(TESTFILES_TL) @rm -rf var - @cd $(TESTDIR); for f in $(TESTFILES_TL); do \ + @for f in $(TESTFILES_TL); do \ echo "check: luatex $$f"; \ - $(TESTENV) luatex --interaction=batchmode ../$$f \ + luatex --interaction=batchmode $$f \ > /dev/null || exit $$?; \ done -- cgit v1.2.3 From 0736fb6f4a24ed1f645e2c197170ce211c562a84 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 17:42:51 +0200 Subject: New version of marks test, nothing new --- tests/marks.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/marks.tex b/tests/marks.tex index d33c82a..3af264e 100644 --- a/tests/marks.tex +++ b/tests/marks.tex @@ -1,6 +1,9 @@ \input luaotfload.sty \font\test={file:GenBasR.ttf:script=latn} +\test ä\quad Ä + \test a\char"0308 \quad A\char"0308 \quad j\char"0323 + \bye -- cgit v1.2.3 From 11634a490e4a39e7ae066a6701fd367bddd874d7 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 17:43:26 +0200 Subject: Adding fontspec test file --- tests/fontspec_lookup.ltx | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/fontspec_lookup.ltx diff --git a/tests/fontspec_lookup.ltx b/tests/fontspec_lookup.ltx new file mode 100644 index 0000000..6645427 --- /dev/null +++ b/tests/fontspec_lookup.ltx @@ -0,0 +1,41 @@ +\documentclass[a5paper,12pt]{scrartcl} +\usepackage{fontspec} +%% -------------------------------------------------------------------- +%% weirdness ahead +%% -------------------------------------------------------------------- +\setmainfont + [Numbers=Lining, + BoldFont={TeX Gyre Pagella Bold}, + BoldItalicFont={TeX Gyre Termes BoldItalic}] + {EB Garamond} +%% -------------------------------------------------------------------- + +%% -------------------------------------------------------------------- +%% excerpt from samples/knuth.tex +%% -------------------------------------------------------------------- +\def\knuth{% + Thus, I came to the conclusion that the designer of a new + system must not only be the implementer and first + large--scale user; the designer should also write the first + user manual. + + The separation of any of these four components would have + hurt \TeX\ significantly. If I had not participated fully in + all these activities, literally hundreds of improvements + would never have been made, because I would never have + thought of them or perceived why they were important. + +} + +%% -------------------------------------------------------------------- +%% main +%% -------------------------------------------------------------------- +\begin{document} + + \section{regular} {\rmfamily\upshape\knuth} + \section{bold face} {\rmfamily\bfseries\knuth} + \section{italic} {\rmfamily\itshape\knuth} + \section{slanted} {\rmfamily\slshape\knuth} + \section{bold italic} {\rmfamily\bfseries\itshape\knuth} + +\end{document} -- cgit v1.2.3 From c07fee9600a52d1990868b6e900a1397a1aebafe Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 17:44:50 +0200 Subject: Fixing outdated math test --- tests/math.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/math.tex b/tests/math.tex index 55bb2aa..a2615f1 100644 --- a/tests/math.tex +++ b/tests/math.tex @@ -35,7 +35,6 @@ $$ $$ \Umathaccent "0 "4 "23DE {a+b} -+ \Umathbotaccent "0 "4 "23DF {a+b} = C $$ $$ -- cgit v1.2.3 From ea1bf4512a22082e3e6c712c4f0722be31452cf1 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 17:48:57 +0200 Subject: Oops --- tests/microtypography.tex | 4 ++-- tests/opbd.tex | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/microtypography.tex b/tests/microtypography.tex index f2d461d..99deb5f 100644 --- a/tests/microtypography.tex +++ b/tests/microtypography.tex @@ -5,7 +5,7 @@ \font\testa=file:texgyretermes-regular:script=latn at 12pt \font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt -\testa We thrive in information||thick worlds because of our +\testa We thrive in information thick worlds because of our marvelous and everyday capacity to select, edit, single out, structure, highlight, group, pair, merge, harmonize, synthesize, focus, organize, condense, @@ -19,7 +19,7 @@ flip through, browse, glance into, leaf through, skim, refine, enumerate, glean, synopsize, winnow the wheat from the chaff and separate the sheep from the goats.\par -\testb We thrive in information||thick worlds because of our +\testb We thrive in information thick worlds because of our marvelous and everyday capacity to select, edit, single out, structure, highlight, group, pair, merge, harmonize, synthesize, focus, organize, condense, diff --git a/tests/opbd.tex b/tests/opbd.tex index 3d26662..1a838cd 100644 --- a/tests/opbd.tex +++ b/tests/opbd.tex @@ -5,7 +5,7 @@ \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 We thrive in information||thick worlds because of our +\testa We thrive in information thick worlds because of our marvelous and everyday capacity to select, edit, single out, structure, highlight, group, pair, merge, harmonize, synthesize, focus, organize, condense, @@ -19,7 +19,7 @@ flip through, browse, glance into, leaf through, skim, refine, enumerate, glean, synopsize, winnow the wheat from the chaff and separate the sheep from the goats.\par -\testb We thrive in information||thick worlds because of our +\testb We thrive in information thick worlds because of our marvelous and everyday capacity to select, edit, single out, structure, highlight, group, pair, merge, harmonize, synthesize, focus, organize, condense, -- cgit v1.2.3 From 77576a1a919a9e97ca51493ba2f37060d1358af1 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 17:50:41 +0200 Subject: Adding the .ltx files in the tests --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0a8770d..ae850ff 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ SOURCE = $(DTX) $(OTFL) README Makefile NEWS $(SCRIPT) # test files TESTDIR = tests -TESTFILES = $(wildcard $(TESTDIR)/*.tex) +TESTFILES = $(wildcard $(TESTDIR)/*.tex $(TESTDIR)/*.ltx) TESTFILES_SYS = $(TESTDIR)/systemfonts.tex $(TESTDIR)/fontconfig_conf_reading.tex TESTFILES_TL = $(filter-out $(TESTFILES_SYS), $(TESTFILES)) -- cgit v1.2.3 From 90cbb697883ead85063e26fc33784e0f366a262f Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 17:51:14 +0200 Subject: Renaming microtypography (.tex -> .ltx) --- tests/microtypography.ltx | 36 ++++++++++++++++++++++++++++++++++++ tests/microtypography.tex | 36 ------------------------------------ 2 files changed, 36 insertions(+), 36 deletions(-) create mode 100644 tests/microtypography.ltx delete mode 100644 tests/microtypography.tex diff --git a/tests/microtypography.ltx b/tests/microtypography.ltx new file mode 100644 index 0000000..99deb5f --- /dev/null +++ b/tests/microtypography.ltx @@ -0,0 +1,36 @@ +\input luaotfload.sty + +\pdfprotrudechars2 \pdfadjustspacing2 + +\font\testa=file:texgyretermes-regular:script=latn at 12pt +\font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt + +\testa We thrive in information thick worlds because of our +marvelous and everyday capacity to select, edit, +single out, structure, highlight, group, pair, merge, +harmonize, synthesize, focus, organize, condense, +reduce, boil down, choose, categorize, catalog, classify, +list, abstract, scan, look into, idealize, isolate, +discriminate, distinguish, screen, pigeonhole, pick over, +sort, integrate, blend, inspect, filter, lump, skip, +smooth, chunk, average, approximate, cluster, aggregate, +outline, summarize, itemize, review, dip into, +flip through, browse, glance into, leaf through, skim, +refine, enumerate, glean, synopsize, winnow the wheat +from the chaff and separate the sheep from the goats.\par + +\testb We thrive in information thick worlds because of our +marvelous and everyday capacity to select, edit, +single out, structure, highlight, group, pair, merge, +harmonize, synthesize, focus, organize, condense, +reduce, boil down, choose, categorize, catalog, classify, +list, abstract, scan, look into, idealize, isolate, +discriminate, distinguish, screen, pigeonhole, pick over, +sort, integrate, blend, inspect, filter, lump, skip, +smooth, chunk, average, approximate, cluster, aggregate, +outline, summarize, itemize, review, dip into, +flip through, browse, glance into, leaf through, skim, +refine, enumerate, glean, synopsize, winnow the wheat +from the chaff and separate the sheep from the goats.\par + +\bye diff --git a/tests/microtypography.tex b/tests/microtypography.tex deleted file mode 100644 index 99deb5f..0000000 --- a/tests/microtypography.tex +++ /dev/null @@ -1,36 +0,0 @@ -\input luaotfload.sty - -\pdfprotrudechars2 \pdfadjustspacing2 - -\font\testa=file:texgyretermes-regular:script=latn at 12pt -\font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt - -\testa We thrive in information thick worlds because of our -marvelous and everyday capacity to select, edit, -single out, structure, highlight, group, pair, merge, -harmonize, synthesize, focus, organize, condense, -reduce, boil down, choose, categorize, catalog, classify, -list, abstract, scan, look into, idealize, isolate, -discriminate, distinguish, screen, pigeonhole, pick over, -sort, integrate, blend, inspect, filter, lump, skip, -smooth, chunk, average, approximate, cluster, aggregate, -outline, summarize, itemize, review, dip into, -flip through, browse, glance into, leaf through, skim, -refine, enumerate, glean, synopsize, winnow the wheat -from the chaff and separate the sheep from the goats.\par - -\testb We thrive in information thick worlds because of our -marvelous and everyday capacity to select, edit, -single out, structure, highlight, group, pair, merge, -harmonize, synthesize, focus, organize, condense, -reduce, boil down, choose, categorize, catalog, classify, -list, abstract, scan, look into, idealize, isolate, -discriminate, distinguish, screen, pigeonhole, pick over, -sort, integrate, blend, inspect, filter, lump, skip, -smooth, chunk, average, approximate, cluster, aggregate, -outline, summarize, itemize, review, dip into, -flip through, browse, glance into, leaf through, skim, -refine, enumerate, glean, synopsize, winnow the wheat -from the chaff and separate the sheep from the goats.\par - -\bye -- cgit v1.2.3 From e49d16d82efc3327faa3143ce31a7bc2e9d09a93 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 17:52:57 +0200 Subject: Hmmm... --- tests/microtypography.ltx | 36 ------------------------------------ tests/microtypography.tex | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 tests/microtypography.ltx create mode 100644 tests/microtypography.tex diff --git a/tests/microtypography.ltx b/tests/microtypography.ltx deleted file mode 100644 index 99deb5f..0000000 --- a/tests/microtypography.ltx +++ /dev/null @@ -1,36 +0,0 @@ -\input luaotfload.sty - -\pdfprotrudechars2 \pdfadjustspacing2 - -\font\testa=file:texgyretermes-regular:script=latn at 12pt -\font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt - -\testa We thrive in information thick worlds because of our -marvelous and everyday capacity to select, edit, -single out, structure, highlight, group, pair, merge, -harmonize, synthesize, focus, organize, condense, -reduce, boil down, choose, categorize, catalog, classify, -list, abstract, scan, look into, idealize, isolate, -discriminate, distinguish, screen, pigeonhole, pick over, -sort, integrate, blend, inspect, filter, lump, skip, -smooth, chunk, average, approximate, cluster, aggregate, -outline, summarize, itemize, review, dip into, -flip through, browse, glance into, leaf through, skim, -refine, enumerate, glean, synopsize, winnow the wheat -from the chaff and separate the sheep from the goats.\par - -\testb We thrive in information thick worlds because of our -marvelous and everyday capacity to select, edit, -single out, structure, highlight, group, pair, merge, -harmonize, synthesize, focus, organize, condense, -reduce, boil down, choose, categorize, catalog, classify, -list, abstract, scan, look into, idealize, isolate, -discriminate, distinguish, screen, pigeonhole, pick over, -sort, integrate, blend, inspect, filter, lump, skip, -smooth, chunk, average, approximate, cluster, aggregate, -outline, summarize, itemize, review, dip into, -flip through, browse, glance into, leaf through, skim, -refine, enumerate, glean, synopsize, winnow the wheat -from the chaff and separate the sheep from the goats.\par - -\bye diff --git a/tests/microtypography.tex b/tests/microtypography.tex new file mode 100644 index 0000000..99deb5f --- /dev/null +++ b/tests/microtypography.tex @@ -0,0 +1,36 @@ +\input luaotfload.sty + +\pdfprotrudechars2 \pdfadjustspacing2 + +\font\testa=file:texgyretermes-regular:script=latn at 12pt +\font\testb=file:texgyretermes-regular:script=latn;protrusion=default at 12pt + +\testa We thrive in information thick worlds because of our +marvelous and everyday capacity to select, edit, +single out, structure, highlight, group, pair, merge, +harmonize, synthesize, focus, organize, condense, +reduce, boil down, choose, categorize, catalog, classify, +list, abstract, scan, look into, idealize, isolate, +discriminate, distinguish, screen, pigeonhole, pick over, +sort, integrate, blend, inspect, filter, lump, skip, +smooth, chunk, average, approximate, cluster, aggregate, +outline, summarize, itemize, review, dip into, +flip through, browse, glance into, leaf through, skim, +refine, enumerate, glean, synopsize, winnow the wheat +from the chaff and separate the sheep from the goats.\par + +\testb We thrive in information thick worlds because of our +marvelous and everyday capacity to select, edit, +single out, structure, highlight, group, pair, merge, +harmonize, synthesize, focus, organize, condense, +reduce, boil down, choose, categorize, catalog, classify, +list, abstract, scan, look into, idealize, isolate, +discriminate, distinguish, screen, pigeonhole, pick over, +sort, integrate, blend, inspect, filter, lump, skip, +smooth, chunk, average, approximate, cluster, aggregate, +outline, summarize, itemize, review, dip into, +flip through, browse, glance into, leaf through, skim, +refine, enumerate, glean, synopsize, winnow the wheat +from the chaff and separate the sheep from the goats.\par + +\bye -- cgit v1.2.3 From 1828aabd4a79d6d31dfc93bb77a500c648b6ba3f Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 20 Apr 2013 18:16:18 +0200 Subject: Adding a test for quite uncommon otf features This is a font I actually use... --- tests/zero_width_marks_lig.tex | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/zero_width_marks_lig.tex diff --git a/tests/zero_width_marks_lig.tex b/tests/zero_width_marks_lig.tex new file mode 100644 index 0000000..9dbaac0 --- /dev/null +++ b/tests/zero_width_marks_lig.tex @@ -0,0 +1,13 @@ +\input luaotfload.sty + +% https://bugs.freedesktop.org/attachment.cgi?id=72363 +\font\testa=file:TestLig.ttf:script=tibt;+ccmp+abvs+blws+kern at 10pt + +\testa གཚོའི་ཁིའུ་ཨཱཿཀ + +% good result for the first part: +% https://bugs.freedesktop.org/attachment.cgi?id=72365 +% for the second part, the two circles shoud appear clearlybefore the last +% letter, not mixed with it + +\bye -- cgit v1.2.3 From e7b982403c2c77e22a263e87b4d40bb226d61107 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sun, 21 Apr 2013 12:10:25 +0200 Subject: A possible bug in otfl-fonts-merged.lua? Really nothing at all but who knows... this should be reported to Hans. --- otfl-fonts-merged.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/otfl-fonts-merged.lua b/otfl-fonts-merged.lua index 19c8ce1..e095153 100644 --- a/otfl-fonts-merged.lua +++ b/otfl-fonts-merged.lua @@ -2988,7 +2988,7 @@ end do local cachepaths=kpse.expand_path('$TEXMFCACHE') or "" if cachepaths=="" then - cachepaths=kpse.expand_path('$TEXMFVAR') + cachepaths=kpse.expand_path('$TEXMFVAR') or "" end if cachepaths=="" then cachepaths=kpse.expand_path('$VARTEXMF') -- cgit v1.2.3 From 14b3ba09e583caaa7e31ab7bfabc4871cbb206fd Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sun, 21 Apr 2013 15:17:58 +0200 Subject: Using caches.* functions from ConTeXt (fixes Issue #5) --- otfl-font-nms.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index e8ad626..3ee6ee4 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -53,14 +53,25 @@ fonts = fonts or { } fonts.names = fonts.names or { } local names = fonts.names -local names_dir = "luatex-cache/generic/names" + names.version = 2.2 names.data = nil names.path = { basename = "otfl-names.lua", - dir = filejoin(kpse.expand_var("$TEXMFVAR"), names_dir), + dir = "", + path = "", } +-- We use the cache.* of ConTeXt (see luat-basics-gen), we can +-- use it safely (all checks and directory creations are already done). It +-- uses TEXMFCACHE or TEXMFVAR as starting points. +local writable_path = caches.getwritablepath("names","") +if not writable_path then + error("Impossible to find a suitable writeable cache...") +end +names.path.dir = writable_path +names.path.path = filejoin(writable_path, names.path.basename) + ---- --- @@ -161,8 +172,7 @@ local scan_external_dir local update_names load_names = function ( ) - local path = filejoin(names.path.dir, names.path.basename) - local foundname, data = load_lua_file(path) + local foundname, data = load_lua_file(names.path.path) if data then report("info", 0, "Font names database loaded", "%s", foundname) -- cgit v1.2.3 From 397c25951b2b1fd8e67e2ddea651b0ee953b0f36 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sun, 21 Apr 2013 15:29:44 +0200 Subject: A wonderful bug fix --- otfl-font-nms.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 3ee6ee4..c9c700c 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -927,12 +927,17 @@ local function get_os_dirs() elseif os.type == "windows" or os.type == "msdos" or os.name == "cygwin" then local windir = os.getenv("WINDIR") return { filejoin(windir, 'Fonts') } - else --- TODO what about ~/config/fontconfig/fonts.conf etc? + else + local passed_paths = {} + local os_dirs = {} + -- what about ~/config/fontconfig/fonts.conf etc? + -- Answer: they should be included by the others, please report if it's not for _,p in next, {"/usr/local/etc/fonts/fonts.conf", "/etc/fonts/fonts.conf"} do if lfs.isfile(p) then - return read_fonts_conf("/etc/fonts/fonts.conf", {}, {}) + read_fonts_conf(p, os_dirs, passed_paths) end end + return os_dirs end return {} end -- cgit v1.2.3 From 908c644982184f1119339a6abeb6fb8b548d5710 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sun, 21 Apr 2013 15:42:55 +0200 Subject: Adding a little TODO and commenting a XXX --- otfl-font-nms.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index c9c700c..2e54028 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -6,6 +6,11 @@ if not modules then modules = { } end modules ['font-nms'] = { license = "GNU GPL v2" } +--- TODO: if the specification is an absolute filename with a font not in the +--- database, add the font to the database and load it. There is a small +--- difficulty with the filenames of the TEXMF tree that are referenced as +--- relative paths... + --- Luatex builtins local load = load local next = next @@ -246,7 +251,7 @@ font database created by the mkluatexfontdb script. --- --- the return value of “resolve” is the file name of the requested --- font - +--- --- 'a -> 'a -> table -> (string * string | bool * bool) --- --- note by phg: I added a third return value that indicates a @@ -390,12 +395,12 @@ resolve = function (_,_,specification) -- the 1st two parameters are used by Con return reload_db(resolve, nil, nil, specification) else --- else, fallback to requested name - --- XXX: specification.name is empty with absolute paths, looks - --- like a bug in the specification parser + --- specification.name is empty with absolute paths, looks + --- like a bug in the specification parser << is it still + --- relevant? looks not... return specification.name, false, false end end - else --- no db or outdated; reload names and retry if not fonts_reloaded then return reload_db(resolve, nil, nil, specification) -- cgit v1.2.3 From 7f0665e076a4a80079b103335e9cd02bd88e4c37 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sun, 21 Apr 2013 15:43:18 +0200 Subject: Adding a test with absolute path in file: specification --- tests/fullname.tex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/fullname.tex b/tests/fullname.tex index 0209c98..78cf4d0 100644 --- a/tests/fullname.tex +++ b/tests/fullname.tex @@ -3,7 +3,13 @@ \font\testa={LM Roman Slanted 10 Regular} at 10pt \font\testb={LM Roman 9 Italic} at 10pt \font\testc={TeX Gyre Termes Bold} at 25pt +% Also testing with absolute filename, please change the path according to your +% system +\font\testd=file:/usr/share/texmf/fonts/opentype/public/lm/lmmono10-italic.otf + \testa abcd ABCD\par \testb abcd ABCD\par \testc abcd ABCD\par +\testd abcd ABCD\par + \bye -- cgit v1.2.3 From 20e92df3bcad34b2951df17182cdb4c8ffef210a Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sun, 21 Apr 2013 15:52:35 +0200 Subject: Adding more technical details in the failing test --- tests/zero_width_marks_lig.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/zero_width_marks_lig.tex b/tests/zero_width_marks_lig.tex index 9dbaac0..2c6dba9 100644 --- a/tests/zero_width_marks_lig.tex +++ b/tests/zero_width_marks_lig.tex @@ -10,4 +10,7 @@ % for the second part, the two circles shoud appear clearlybefore the last % letter, not mixed with it +% see http://lists.freedesktop.org/archives/harfbuzz/2013-April/003101.html +% for some technical details. + \bye -- cgit v1.2.3