From c452fefcdf8316b946ed64c9849342cc012b7394 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 13:12:09 +0200 Subject: [features] fix buggy state check --- src/luaotfload-features.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index 250fbc8..2148019 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -36,12 +36,11 @@ local config = config or { luaotfload = { run = { } } } local as_script = true local normalize = function () end -if config.luaotfload.run.live == true then +if config.luaotfload.run.live ~= false then normalize = handlers.otf.features.normalize as_script = false end - --HH A bit of tuning for definitions. if fonts.constructors then -- cgit v1.2.3 From 43f70e0cb460dc46391664191f56e07b281e5698 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 15:22:08 +0200 Subject: [fontloader] quick fix by Hans for issue #326 Addresses #326 This is a hot-fix with non-official code. The actual fix will come downstream later from Context as usual. --- src/fontloader/misc/fontloader-font-ots.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/fontloader/misc/fontloader-font-ots.lua b/src/fontloader/misc/fontloader-font-ots.lua index c3e1f48..0a438d5 100644 --- a/src/fontloader/misc/fontloader-font-ots.lua +++ b/src/fontloader/misc/fontloader-font-ots.lua @@ -756,8 +756,14 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature) -- kind of weird break elseif id == disc_code then - lastdisc = current - current = getnext(current) + if getfield(current,"replace") then + -- this only happens when we didn't normalize ... in a future version we will + -- assume normalization of disc nodes + break + else + lastdisc=current + current=getnext(current) + end else break end -- cgit v1.2.3 From 718bfce1622980a60ce51c2c5b739ff975918dd5 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 21:04:26 +0200 Subject: [db] undo commented out texmf tree processing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit D’oh! Too much debugging =) --- src/luaotfload-database.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index fd806e0..f1be490 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -2955,7 +2955,7 @@ local collect_font_filenames = function () local bisect = config.luaotfload.misc.bisect local max_fonts = config.luaotfload.db.max_fonts --- XXX revisit for lua 5.3 wrt integers - --tableappend (filenames, collect_font_filenames_texmf ()) + tableappend (filenames, collect_font_filenames_texmf ()) tableappend (filenames, collect_font_filenames_system ()) if config.luaotfload.db.scan_local == true then tableappend (filenames, collect_font_filenames_local ()) -- cgit v1.2.3 From ec774e0e4d16ed440e6b892a7325b304aec82e71 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 21:41:09 +0200 Subject: [features] adjust feature processor to new data structures --- src/luaotfload-features.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index 2148019..16422db 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -1853,12 +1853,18 @@ otf.addfeature = add_otf_feature local install_extra_features = function (data, filename, raw) for feature, specification in next, extrafeatures do + local fontname + local subfont + local metadata = data.metadata + if metadata then + fontname = tostring (data.metadata.fontname) + subfont = tonumber (metadata.subfontindex) + end + if not fontname then fontname = "" end + if not subfont then subfont = -1 end logreport ("both", 3, "features", "register synthetic feature “%s” for %s font “%s”(%d)", - feature, - data.format, - tostring (data.metadata and data.metadata.fontname or ""), - data.subfont or -1) + feature, data.format, fontname, subfont) otf.features.register { name = feature, description = specification[2] } otf.enhancers.addfeature (data, feature, specification[1]) end -- cgit v1.2.3 From b6569eef1dc488aafbdef8a12ddd68cdef1d5b72 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 22:12:10 +0200 Subject: [features] account for subfont indexing changes The new Lua based loader consistently numbers subfonts from one, not zero like the Fontforge one. We correct the value immediately before passing a handled font request on to the loader. --- src/luaotfload-features.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index 16422db..9817e0b 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -1246,6 +1246,10 @@ local handle_request = function (specification) --- investigated it any further (luatex-fonts-ext), so it will --- just stay here. specification.features.normal = normalize (request.features) + local subfont = tonumber (specification.sub) + if subfont and subfont >= 0 then + specification.sub = subfont + 1 + end return specification end -- cgit v1.2.3 From e1dbb2d934d52bd74c5748ede74ae5bd32a86465 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 22:21:08 +0200 Subject: =?UTF-8?q?[doc]=20describe=20=E2=80=9Cuse-fontforge=E2=80=9D=20op?= =?UTF-8?q?tion=20in=20man=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/luaotfload.conf.rst | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/doc/luaotfload.conf.rst b/doc/luaotfload.conf.rst index 5cb74f0..6cd4cd5 100644 --- a/doc/luaotfload.conf.rst +++ b/doc/luaotfload.conf.rst @@ -6,7 +6,7 @@ Luaotfload configuration file ----------------------------------------------------------------------- -:Date: 2016-04-07 +:Date: 2016-04-17 :Copyright: GPL v2.0 :Version: 2.7 :Manual section: 5 @@ -126,23 +126,25 @@ the variable is unset. Section ``db`` ----------------------------------------------------------------------- -+---------------+--------+---------------------------+ -| variable | type | default | -+---------------+--------+---------------------------+ -| compress | b | ``true`` | -+---------------+--------+---------------------------+ -| formats | s | ``"otf,ttf,ttc,dfont"`` | -+---------------+--------+---------------------------+ -| max-fonts | n | ``2^51`` | -+---------------+--------+---------------------------+ -| scan-local | b | ``false`` | -+---------------+--------+---------------------------+ -| skip-read | b | ``false`` | -+---------------+--------+---------------------------+ -| strip | b | ``true`` | -+---------------+--------+---------------------------+ -| update-live | b | ``true`` | -+---------------+--------+---------------------------+ ++-----------------+--------+---------------------------+ +| variable | type | default | ++-----------------+--------+---------------------------+ +| compress | b | ``true`` | ++-----------------+--------+---------------------------+ +| formats | s | ``"otf,ttf,ttc,dfont"`` | ++-----------------+--------+---------------------------+ +| max-fonts | n | ``2^51`` | ++-----------------+--------+---------------------------+ +| scan-local | b | ``false`` | ++-----------------+--------+---------------------------+ +| skip-read | b | ``false`` | ++-----------------+--------+---------------------------+ +| strip | b | ``true`` | ++-----------------+--------+---------------------------+ +| update-live | b | ``true`` | ++-----------------+--------+---------------------------+ +| use-fontforge | b | ``false`` | ++-----------------+--------+---------------------------+ The flag ``compress`` determines whether the font index (usually ``luaotfload-names.lua[.gz]`` will be stored in compressed forms. @@ -189,6 +191,10 @@ If ``update-live`` is set, Luaotfload will reload the database if it cannot find a requested font. Those who prefer to update manually using **luaotfload-tool** should unset this flag. +The option ``use-fontforge`` switches name scanning back to the old +method that relies on the builtin ``fontloader`` library. This is +interesting for reference until the Fontforge code will be removed +eventually. Section ``default-features`` ----------------------------------------------------------------------- -- cgit v1.2.3 From ed7ae06e1279c969091646c2de7da9ea87151075 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 22:23:40 +0200 Subject: =?UTF-8?q?[conf]=20move=20=E2=80=9Cuse-fontforge=E2=80=9D=20optio?= =?UTF-8?q?n=20into=20section=20=E2=80=9C[db]=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only font indexing is affected by “use-fontforge”. The fontloader itself will always use the new code. --- src/luaotfload-configuration.lua | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index f19b9bc..50ac0bd 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -189,13 +189,14 @@ local permissible_color_callbacks = { local default_config = { db = { - formats = "otf,ttf,ttc,dfont", - scan_local = false, - skip_read = false, - strip = true, - update_live = true, - compress = true, - max_fonts = 2^51, + formats = "otf,ttf,ttc,dfont", + scan_local = false, + skip_read = false, + strip = true, + update_live = true, + compress = true, + max_fonts = 2^51, + use_fontforge = false, }, run = { resolver = "cached", @@ -203,7 +204,6 @@ local default_config = { log_level = 0, color_callback = "post_linebreak_filter", fontloader = default_fontloader (), - use_fontforge = false, }, misc = { bisect = false, @@ -377,7 +377,7 @@ local set_fontforge = function () logreport ("log", 4, "db", "Database not present.") return true end - local use_ff = config.luaotfload.run.use_fontforge + local use_ff = config.luaotfload.db.use_fontforge if use_ff == true then if not _G.fontloader then logreport ("both", 0, "db", @@ -500,6 +500,7 @@ local option_spec = { out_t = number_t, --- TODO int_t from 5.3.x on transform = tointeger, }, + use_fontforge = { in_t = boolean_t, }, }, run = { live = { in_t = boolean_t, }, --- false for the tool, true for TeX run @@ -535,7 +536,6 @@ local option_spec = { return id end, }, - use_fontforge = { in_t = boolean_t, }, log_level = { in_t = number_t, out_t = number_t, --- TODO int_t from 5.3.x on @@ -669,13 +669,14 @@ local conf_footer = [==[ local formatters = { db = { - compress = { false, format_boolean }, - formats = { false, format_string }, - max_fonts = { false, format_integer }, - scan_local = { false, format_boolean }, - skip_read = { false, format_boolean }, - strip = { false, format_boolean }, - update_live = { false, format_boolean }, + compress = { false, format_boolean }, + formats = { false, format_string }, + max_fonts = { false, format_integer }, + scan_local = { false, format_boolean }, + skip_read = { false, format_boolean }, + strip = { false, format_boolean }, + update_live = { false, format_boolean }, + use_fontforge = { false, format_boolean }, }, default_features = { __default = { true, format_keyval }, @@ -698,7 +699,6 @@ local formatters = { fontloader = { false, format_string }, log_level = { false, format_integer }, resolver = { false, format_string }, - use_fontforge = { false, format_boolean }, }, } -- cgit v1.2.3 From b6d2ddab605f18544a757f54de5b9ced15c6add1 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 18 Apr 2016 07:57:40 +0200 Subject: [db] fix misleading error message No such warnings with the new loader. Instead we need to test for the ``fontname`` / ``fullname`` fields. Thanks to @dohyunkim for reporting. --- src/luaotfload-database.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index f1be490..4944de1 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -1437,14 +1437,12 @@ local get_raw_info = function (metadata, basename) local fullname = metadata.fullname local validation_state = metadata.validation_state - if (validation_state and tablecontains (validation_state, "bad_ps_fontname")) - or not fontname - then + if not fontname or not fullname then --- Broken names table, e.g. avkv.ttf with UTF-16 strings; --- we put some dummies in place like the fontloader --- (font-otf.lua) does. logreport ("both", 3, "db", - "%s has invalid postscript font names, using dummies.", + "invalid names table of font %s, using dummies.", basename) fontname = "bad-fontname-" .. basename fullname = "bad-fullname-" .. basename -- cgit v1.2.3 From 81566459ade8e03f22f19ebae7003aaa9b1e83ad Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 18 Apr 2016 08:12:39 +0200 Subject: [doc] update file list --- doc/luaotfload-main.tex | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/doc/luaotfload-main.tex b/doc/luaotfload-main.tex index d19906e..a24a837 100644 --- a/doc/luaotfload-main.tex +++ b/doc/luaotfload-main.tex @@ -1160,6 +1160,7 @@ and have thus been omitted from the merge.\footnote{% \beginaltitem {l-boolean.lua} \endaltitem \beginaltitem {l-math.lua} \endaltitem \beginaltitem {util-str.lua} \endaltitem + \beginaltitem {util-fil.lua} \endaltitem \enddefinitions \enddoublecolumns @@ -1169,30 +1170,28 @@ grouped twofold as below: \begindefinitions \beginnormalitem The \emphasis{font loader} itself. - These files have been written for - \LUATEX-Fonts and they are distributed along - with \identifier{luaotfload}. + These files have been written for \LUATEX-Fonts and they are + distributed along with \identifier{luaotfload} so as to resemble + the state of the code when it was imported. Their purpose is either + to give a slightly aged version of a file if upstream considers + latest developments for not yet ready for use outside Context; or, + to install placeholders or minimalist versions of APIs relied upon + but usually provided by parts of Context not included in the + fontloader. \begindoublecolumns \begindefinitions \beginaltitem{luatex-basics-nod.lua} \endaltitem + \beginaltitem{luatex-basics-chr.lua} \endaltitem \beginaltitem{luatex-fonts-enc.lua} \endaltitem \beginaltitem{luatex-fonts-syn.lua} \endaltitem - \beginaltitem{luatex-fonts-tfm.lua} \endaltitem - \beginaltitem{luatex-fonts-chr.lua} \endaltitem - \beginaltitem{luatex-fonts-lua.lua} \endaltitem - \beginaltitem{luatex-fonts-inj.lua} \endaltitem - \beginaltitem{luatex-fonts-otn.lua} \endaltitem - \beginaltitem{luatex-fonts-def.lua} \endaltitem \beginaltitem{luatex-fonts-ext.lua} \endaltitem - \beginaltitem{luatex-fonts-cbk.lua} \endaltitem \enddefinitions \enddoublecolumns \endnormalitem \beginnormalitem - Code related to \emphasis{font handling and - node processing}, taken directly from - \CONTEXT. + Code related to \emphasis{font handling and node processing}, taken + directly from \CONTEXT. \begindoublecolumns \begindefinitions \beginaltitem{data-con.lua} \endaltitem @@ -1200,12 +1199,25 @@ grouped twofold as below: \beginaltitem{font-con.lua} \endaltitem \beginaltitem{font-cid.lua} \endaltitem \beginaltitem{font-map.lua} \endaltitem + \beginaltitem{font-tfm.lua} \endaltitem + \beginaltitem{font-afm.lua} \endaltitem + \beginaltitem{font-afk.lua} \endaltitem \beginaltitem{font-oti.lua} \endaltitem - \beginaltitem{font-otf.lua} \endaltitem - \beginaltitem{font-otb.lua} \endaltitem + \beginaltitem{font-otr.lua} \endaltitem + \beginaltitem{font-cff.lua} \endaltitem + \beginaltitem{font-ttf.lua} \endaltitem + \beginaltitem{font-dsp.lua} \endaltitem + \beginaltitem{font-oup.lua} \endaltitem + \beginaltitem{font-otl.lua} \endaltitem + \beginaltitem{font-oto.lua} \endaltitem + \beginaltitem{font-otj.lua} \endaltitem \beginaltitem{font-ota.lua} \endaltitem + \beginaltitem{font-ots.lua} \endaltitem + \beginaltitem{font-osd.lua} \endaltitem + \beginaltitem{font-lua.lua} \endaltitem \beginaltitem{font-def.lua} \endaltitem - \beginaltitem{font-otp.lua} \endaltitem + \beginaltitem{font-xtx.lua} \endaltitem + \beginaltitem{font-gbn.lua} \endaltitem \enddefinitions \enddoublecolumns \endnormalitem -- cgit v1.2.3 From b8b264a266beed6f95e53ea1801bd96f345fc745 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 18 Apr 2016 20:24:16 +0200 Subject: [fontloader] sync with Context as of 2016-04-18 --- src/fontloader/misc/fontloader-font-gbn.lua | 24 ++++++++- src/fontloader/misc/fontloader-font-ots.lua | 60 +++++++++++++++------ src/fontloader/misc/fontloader-font-oup.lua | 23 +++++--- src/fontloader/runtime/fontloader-reference.lua | 71 +++++++++++++++++++++---- 4 files changed, 145 insertions(+), 33 deletions(-) diff --git a/src/fontloader/misc/fontloader-font-gbn.lua b/src/fontloader/misc/fontloader-font-gbn.lua index a645a97..daa072b 100644 --- a/src/fontloader/misc/fontloader-font-gbn.lua +++ b/src/fontloader/misc/fontloader-font-gbn.lua @@ -20,6 +20,7 @@ local nuts = nodes.nuts -- context abstraction of direct nodes local traverse_id = nuts.traverse_id local remove_node = nuts.remove +local free_node = nuts.free local glyph_code = nodes.nodecodes.glyph local disc_code = nodes.nodecodes.disc @@ -30,11 +31,13 @@ local tonut = nuts.tonut local getfont = nuts.getfont local getchar = nuts.getchar local getid = nuts.getid +local getboth = nuts.getboth local getprev = nuts.getprev local getnext = nuts.getnext local getdisc = nuts.getdisc local setchar = nuts.setchar local setlink = nuts.setlink +local setprev = nuts.setprev -- from now on we apply ligaturing and kerning here because it might interfere with complex -- opentype discretionary handling where the base ligature pass expect some weird extra @@ -136,7 +139,26 @@ function nodes.handlers.nodepass(head) end if redundant then for i=1,#redundant do - remove_node(nuthead,redundant[i],true) + local r = redundant[i] + local p, n = getboth(r) + if r == nuthead then + nuthead = n + setprev(n) + else + setlink(p,n) + end + if b > 0 then + for i=1,b do + local bi = basefonts[i] + if r == bi[1] then + bi[1] = n + end + if r == bi[2] then + bi[2] = n + end + end + end + free_node(r) end end for d in traverse_id(disc_code,nuthead) do diff --git a/src/fontloader/misc/fontloader-font-ots.lua b/src/fontloader/misc/fontloader-font-ots.lua index 0a438d5..6911872 100644 --- a/src/fontloader/misc/fontloader-font-ots.lua +++ b/src/fontloader/misc/fontloader-font-ots.lua @@ -696,6 +696,9 @@ end function handlers.gsub_ligature(head,start,dataset,sequence,ligature) local current = getnext(start) + if not current then + return head, start, false, nil + end local stop = nil local startchar = getchar(start) if marks[startchar] then @@ -756,14 +759,30 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature) -- kind of weird break elseif id == disc_code then - if getfield(current,"replace") then - -- this only happens when we didn't normalize ... in a future version we will - -- assume normalization of disc nodes - break - else - lastdisc=current - current=getnext(current) + -- tricky .. we also need to do pre here + local replace = getfield(current,"replace") + if replace then + -- of{f-}{}{f}e o{f-}{}{f}fe o{-}{}{ff}e (oe and ff ligature) + -- we can end up here when we have a start run .. testruns start at a disc but + -- so here we have the other case: char + disc + while replace do + local char, id = ischar(replace,currentfont) + if char then + local lg = ligature[char] -- can there be multiple in a row? maybe in a bad font + if lg then + ligature = lg + replace = getnext(replace) + else + return head, start, false, false + end + else + return head, start, false, false + end + end + stop = current end + lastdisc = current + current = getnext(current) else break end @@ -1287,6 +1306,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup local nofreplacements = 1 local skipmark = currentlookup.flags[1] -- sequence.flags? while current do + -- todo: ischar ... can there really be disc nodes here? local id = getid(current) if id == disc_code then if not discfound then @@ -2761,6 +2781,8 @@ local function kernrun(disc,k_run,font,attr,...) next = false end -- + -- we need to get rid of this nest mess some day .. has to be done otherwise + -- if pre then if k_run(pre,"injections",nil,font,attr,...) then done = true @@ -2768,7 +2790,7 @@ local function kernrun(disc,k_run,font,attr,...) if prev then local nest = getprev(pre) setlink(prev,pre) - if k_run(prevmarks,"preinjections",pre,font,attr,...) then -- getnext(pre)) + if k_run(prevmarks,"preinjections",pre,font,attr,...) then -- or prev? done = true end setprev(pre,nest) @@ -2866,7 +2888,7 @@ local function comprun(disc,c_run,...) setdisc(disc,pre,post,replace) end -- - return getnext(disc), done + return getnext(disc), renewed end local function testrun(disc,t_run,c_run,...) @@ -3006,8 +3028,9 @@ local nesting = 0 local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) local done = false - local start = sweephead[head] - if start then + local sweep = sweephead[head] + if sweep then + start = sweep sweephead[head] = nil else start = head @@ -3033,8 +3056,11 @@ local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlm end elseif char == false then return head, done + elseif sweep then + -- else we loose the rest + return head, done else - -- weird + -- in disc component start = getnext(start) end end @@ -3119,8 +3145,9 @@ end local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler) local done = false - local start = sweephead[head] - if start then + local sweep = sweephead[head] + if sweep then + start = sweep sweephead[head] = nil else start = head @@ -3160,8 +3187,11 @@ local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlm elseif char == false then -- whatever glyph return head, done + elseif sweep then + -- else we loose the rest + return head, done else - -- very unlikely + -- in disc component start = getnext(start) end end diff --git a/src/fontloader/misc/fontloader-font-oup.lua b/src/fontloader/misc/fontloader-font-oup.lua index 59530af..7edaaf6 100644 --- a/src/fontloader/misc/fontloader-font-oup.lua +++ b/src/fontloader/misc/fontloader-font-oup.lua @@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['font-oup'] = { local next, type = next, type local P, R, S = lpeg.P, lpeg.R, lpeg.S local lpegmatch = lpeg.match -local insert, remove, copy = table.insert, table.remove, table.copy +local insert, remove, copy, unpack = table.insert, table.remove, table.copy, table.unpack local formatters = string.formatters local sortedkeys = table.sortedkeys @@ -737,8 +737,7 @@ local function stripredundant(fontdata) end function readers.getcomponents(fontdata) -- handy for resolving ligatures when names are missing - local resources = fontdata.resources - local descriptions = fontdata.descriptions + local resources = fontdata.resources if resources then local sequences = resources.sequences if sequences then @@ -761,7 +760,7 @@ function readers.getcomponents(fontdata) -- handy for resolving ligatures when n end end for i=1,#steps do - -- we actually had/have this in base mode + -- we actually had/have this in base mode local coverage = steps[i].coverage if coverage then for k, v in next, coverage do @@ -773,13 +772,25 @@ function readers.getcomponents(fontdata) -- handy for resolving ligatures when n end end if next(collected) then + -- remove self referring + -- for k, v in next, collected do + -- for i=1,#v do + -- local vi = v[i] + -- if vi == k then + -- -- report("removing self referring ligature @ slot %5X from collected (1)",k) + -- collected[k] = nil + -- end + -- end + -- end while true do local done = false for k, v in next, collected do for i=1,#v do local vi = v[i] if vi == k then + -- report("removing self referring ligature @ slot %5X from collected (2)",k) collected[k] = nil + break else local c = collected[vi] if c then @@ -787,7 +798,7 @@ function readers.getcomponents(fontdata) -- handy for resolving ligatures when n local t = { } local n = i - 1 for j=1,n do - t[j] = t[j] + t[j] = v[j] end for j=1,#c do n = n + 1 @@ -795,7 +806,7 @@ function readers.getcomponents(fontdata) -- handy for resolving ligatures when n end for j=i+1,#v do n = n + 1 - t[n] = t[j] + t[n] = v[j] end collected[k] = t break diff --git a/src/fontloader/runtime/fontloader-reference.lua b/src/fontloader/runtime/fontloader-reference.lua index 0d22a73..1595733 100644 --- a/src/fontloader/runtime/fontloader-reference.lua +++ b/src/fontloader/runtime/fontloader-reference.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 04/17/16 11:56:26 +-- merge date : 04/18/16 18:53:40 do -- begin closure to overcome local limits and interference @@ -13503,7 +13503,7 @@ if not modules then modules={} end modules ['font-oup']={ local next,type=next,type local P,R,S=lpeg.P,lpeg.R,lpeg.S local lpegmatch=lpeg.match -local insert,remove,copy=table.insert,table.remove,table.copy +local insert,remove,copy,unpack=table.insert,table.remove,table.copy,table.unpack local formatters=string.formatters local sortedkeys=table.sortedkeys local sortedhash=table.sortedhash @@ -14169,7 +14169,6 @@ local function stripredundant(fontdata) end function readers.getcomponents(fontdata) local resources=fontdata.resources - local descriptions=fontdata.descriptions if resources then local sequences=resources.sequences if sequences then @@ -14210,6 +14209,7 @@ function readers.getcomponents(fontdata) local vi=v[i] if vi==k then collected[k]=nil + break else local c=collected[vi] if c then @@ -14217,7 +14217,7 @@ function readers.getcomponents(fontdata) local t={} local n=i-1 for j=1,n do - t[j]=t[j] + t[j]=v[j] end for j=1,#c do n=n+1 @@ -14225,7 +14225,7 @@ function readers.getcomponents(fontdata) end for j=i+1,#v do n=n+1 - t[n]=t[j] + t[n]=v[j] end collected[k]=t break @@ -18678,6 +18678,9 @@ function handlers.gsub_multiple(head,start,dataset,sequence,multiple) end function handlers.gsub_ligature(head,start,dataset,sequence,ligature) local current=getnext(start) + if not current then + return head,start,false,nil + end local stop=nil local startchar=getchar(start) if marks[startchar] then @@ -18736,6 +18739,24 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature) elseif char==false then break elseif id==disc_code then + local replace=getfield(current,"replace") + if replace then + while replace do + local char,id=ischar(replace,currentfont) + if char then + local lg=ligature[char] + if lg then + ligature=lg + replace=getnext(replace) + else + return head,start,false,false + end + else + return head,start,false,false + end + end + stop=current + end lastdisc=current current=getnext(current) else @@ -20539,7 +20560,7 @@ local function comprun(disc,c_run,...) if renewed then setdisc(disc,pre,post,replace) end - return getnext(disc),done + return getnext(disc),renewed end local function testrun(disc,t_run,c_run,...) if trace_testruns then @@ -20605,8 +20626,9 @@ end local nesting=0 local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) local done=false - local start=sweephead[head] - if start then + local sweep=sweephead[head] + if sweep then + start=sweep sweephead[head]=nil else start=head @@ -20632,6 +20654,8 @@ local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlm end elseif char==false then return head,done + elseif sweep then + return head,done else start=getnext(start) end @@ -20696,8 +20720,9 @@ local function k_run_single(sub,injection,last,font,attr,lookupcache,step,datase end local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler) local done=false - local start=sweephead[head] - if start then + local sweep=sweephead[head] + if sweep then + start=sweep sweephead[head]=nil else start=head @@ -20734,6 +20759,8 @@ local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlm end elseif char==false then return head,done + elseif sweep then + return head,done else start=getnext(start) end @@ -23867,6 +23894,7 @@ local nodes=nodes local nuts=nodes.nuts local traverse_id=nuts.traverse_id local remove_node=nuts.remove +local free_node=nuts.free local glyph_code=nodes.nodecodes.glyph local disc_code=nodes.nodecodes.disc local tonode=nuts.tonode @@ -23874,11 +23902,13 @@ local tonut=nuts.tonut local getfont=nuts.getfont local getchar=nuts.getchar local getid=nuts.getid +local getboth=nuts.getboth local getprev=nuts.getprev local getnext=nuts.getnext local getdisc=nuts.getdisc local setchar=nuts.setchar local setlink=nuts.setlink +local setprev=nuts.setprev local n_ligaturing=node.ligaturing local n_kerning=node.kerning local ligaturing=nuts.ligaturing @@ -23968,7 +23998,26 @@ function nodes.handlers.nodepass(head) end if redundant then for i=1,#redundant do - remove_node(nuthead,redundant[i],true) + local r=redundant[i] + local p,n=getboth(r) + if r==nuthead then + nuthead=n + setprev(n) + else + setlink(p,n) + end + if b>0 then + for i=1,b do + local bi=basefonts[i] + if r==bi[1] then + bi[1]=n + end + if r==bi[2] then + bi[2]=n + end + end + end + free_node(r) end end for d in traverse_id(disc_code,nuthead) do -- cgit v1.2.3 From 1aa8ca2279febc19daa5f8af4277882e63fa5a34 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 18 Apr 2016 20:35:58 +0200 Subject: [*] update news --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 69f58bd..7325433 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ Change History * Glyph fallbacks. * Latest fontloader code. * Adapt packaging to changed upstream file layout. + * Remove support for builtin Fontforge libraries. 2015/12/09, luaotfload v2.6 * Add ``sign`` target to makefile for automated package signing. -- cgit v1.2.3 From fbb0376f90e3e81048ce8a91df065d708afec36d Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 18 Apr 2016 20:39:24 +0200 Subject: [passim] update maintainer contact --- README | 2 +- doc/luaotfload-latex.tex | 2 +- doc/luaotfload-main.tex | 2 +- doc/luaotfload-tool.rst | 5 ++--- doc/luaotfload.conf.rst | 5 ++--- src/luaotfload.sty | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README b/README index 71490b8..01e1fc6 100644 --- a/README +++ b/README @@ -30,7 +30,7 @@ The following people have contributed to this package. Khaled Hosny Elie Roux Will Robertson -Philipp Gesang +Philipp Gesang Dohyun Kim Reuben Thomas Joseph Wright diff --git a/doc/luaotfload-latex.tex b/doc/luaotfload-latex.tex index bdcf45f..b4cd3c3 100644 --- a/doc/luaotfload-latex.tex +++ b/doc/luaotfload-latex.tex @@ -3,7 +3,7 @@ %% %% by Elie Roux %% and Khaled Hosny -%% and Philipp Gesang +%% and Philipp Gesang %% %% This file is part of Luaotfload. %% diff --git a/doc/luaotfload-main.tex b/doc/luaotfload-main.tex index a24a837..7099f3d 100644 --- a/doc/luaotfload-main.tex +++ b/doc/luaotfload-main.tex @@ -2,7 +2,7 @@ %% %% by Elie Roux %% and Khaled Hosny -%% and Philipp Gesang +%% and Philipp Gesang %% %% This file is part of Luaotfload. %% diff --git a/doc/luaotfload-tool.rst b/doc/luaotfload-tool.rst index 2e3b897..ec35c8a 100644 --- a/doc/luaotfload-tool.rst +++ b/doc/luaotfload-tool.rst @@ -6,7 +6,7 @@ generate and query the Luaotfload font names database ----------------------------------------------------------------------- -:Date: 2016-04-07 +:Date: 2016-04-18 :Copyright: GPL v2.0 :Version: 2.7 :Manual section: 1 @@ -329,6 +329,5 @@ AUTHORS The fontloader code is provided by Hans Hagen of Pragma ADE, Hasselt NL (``__). -This manual page was written by Philipp Gesang -. +This manual page was written by Philipp Gesang . diff --git a/doc/luaotfload.conf.rst b/doc/luaotfload.conf.rst index 6cd4cd5..25f5a5c 100644 --- a/doc/luaotfload.conf.rst +++ b/doc/luaotfload.conf.rst @@ -6,7 +6,7 @@ Luaotfload configuration file ----------------------------------------------------------------------- -:Date: 2016-04-17 +:Date: 2016-04-18 :Copyright: GPL v2.0 :Version: 2.7 :Manual section: 5 @@ -387,6 +387,5 @@ AUTHORS *Luaotfload* is maintained by the LuaLaTeX dev team (``_). -This manual page was written by Philipp Gesang -. +This manual page was written by Philipp Gesang . diff --git a/src/luaotfload.sty b/src/luaotfload.sty index 7b6d4cf..b6f03af 100644 --- a/src/luaotfload.sty +++ b/src/luaotfload.sty @@ -2,7 +2,7 @@ %% %% by Elie Roux %% and Khaled Hosny -%% and Philipp Gesang +%% and Philipp Gesang %% and Dohyun Kim %% and David Carlisle %% -- cgit v1.2.3 From 2f3b7ea9743c9196041d2b31b514a43a3b298ffc Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 18 Apr 2016 20:42:54 +0200 Subject: [tool,doc] inter fontloader warnings option The option has become redundant with the new loader so we might as well get rid of it. --- doc/luaotfload-tool.rst | 3 --- src/luaotfload-tool.lua | 49 +++++++------------------------------------------ 2 files changed, 7 insertions(+), 45 deletions(-) diff --git a/doc/luaotfload-tool.rst b/doc/luaotfload-tool.rst index ec35c8a..5b834b4 100644 --- a/doc/luaotfload-tool.rst +++ b/doc/luaotfload-tool.rst @@ -116,9 +116,6 @@ query mode For the meaning of the returned fields see the LuaTeX documentation. (requires ``--find``). ---warnings, -w Print the warnings generated by the fontloader - library (assumes ``-I``). Automatically enabled - if the verbosity level exceeds 2. --list=CRITERION Show entries, where *CRITERION* is one of the following: diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua index 9b8ffc3..4b4dc50 100755 --- a/src/luaotfload-tool.lua +++ b/src/luaotfload-tool.lua @@ -267,8 +267,6 @@ Usage: %s [OPTIONS...] -i --info display basic font metadata -I --inspect display detailed font metadata - -w --warnings display warnings generated by the - fontloader library --list= output list of entries by field --list=: restrict to entries with = @@ -455,29 +453,6 @@ local show_info_items = function (fontinfo) texiowrite_nl "" end -local p_eol = S"\n\r"^1 -local p_space = S" \t\v"^0 -local p_line = p_space * C((1 - p_eol)^1)^-1 -local p_lines = Ct(p_line * (p_eol^1 * p_line^-1)^0) - -local show_fontloader_warnings = function (ws) - local nws = #ws - print_heading(stringformat( - [[the fontloader emitted %d warnings]], - nws), 2) - texiowrite_nl "" - for i=1, nws do - local w = ws[i] - texiowrite_nl (stringformat("%d:", i)) - local lines = lpegmatch(p_lines, w) - for i=1, #lines do - local line = lines[i] - texiowrite_nl(" · " .. line) - end - texiowrite_nl "" - end -end - local p_spacechar = S" \n\r\t\v" local p_wordchar = (1 - p_spacechar) local p_whitespace = p_spacechar^1 @@ -657,11 +632,8 @@ local display_features = function (features) end end -local show_full_info = function (path, subfont, warnings) +local show_full_info = function (path, subfont) local rawinfo, warn = fonts.handlers.otf.readers.loadfont (path, subfont) - if warnings then - show_fontloader_warnings(warn) - end if not rawinfo then texiowrite_nl(stringformat([[cannot open font %s]], path)) return @@ -694,7 +666,7 @@ The font info knows two levels of detail: returned by readers.loadfont(). --doc]]-- -local show_font_info = function (basename, askedname, detail, warnings) +local show_font_info = function (basename, askedname, detail) local filenames = fonts.names.data().files local index = filenames.base[basename] local fullname = filenames.full[index] @@ -720,7 +692,7 @@ local show_font_info = function (basename, askedname, detail, warnings) if subfont then show_info_items(subfont) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end else -- list all subfonts logreport (true, 1, "resolve", @@ -730,14 +702,14 @@ local show_font_info = function (basename, askedname, detail, warnings) [[Showing info for font no. %d]], n) show_info_items(shortinfo[subfont]) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end end end else show_info_items(shortinfo) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end end else @@ -1212,7 +1184,7 @@ actions.query = function (job) "Resolved file name %q", foundname) end if job.show_info then - show_font_info (foundname, query, job.full_info, job.warnings) + show_font_info (foundname, query, job.full_info) iowrite "\n" end else @@ -1437,7 +1409,6 @@ local process_cmdline = function ( ) -- unit -> jobspec local result = { -- jobspec force_reload = nil, full_info = false, - warnings = false, criterion = "", query = "", log_level = nil, @@ -1478,10 +1449,9 @@ local process_cmdline = function ( ) -- unit -> jobspec update = "u", verbose = 1, version = "V", - warnings = "w", } - local short_options = "bcDfFiIlLnpqRSuvVhw" + local short_options = "bcDfFiIlLnpqRSuvVh" local options, _, optarg = alt_getopt.get_ordered_opts (arg, short_options, long_options) @@ -1513,12 +1483,7 @@ local process_cmdline = function ( ) -- unit -> jobspec if lvl then lvl = tonumber(lvl) result.log_level = lvl - if lvl > 2 then - result.warnings = true - end end - elseif v == "w" then - result.warnings = true elseif v == "log" then local str = optarg[n] if str then -- cgit v1.2.3 From 0ed66c28f6f48c8250a903bed9abf6aee6d8dd39 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 18 Apr 2016 20:48:58 +0200 Subject: [doc] update graph for current file list --- doc/filegraph.dot | 64 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/doc/filegraph.dot b/doc/filegraph.dot index de60823..b274461 100644 --- a/doc/filegraph.dot +++ b/doc/filegraph.dot @@ -309,7 +309,7 @@ strict digraph luaotfload_files { //looks weird with circo ... l-lua.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-file.lua l-boolean.lua l-math.lua - util-str.lua + util-str.lua util-fil.lua >, ] @@ -322,13 +322,17 @@ strict digraph luaotfload_files { //looks weird with circo ... label = < - - - - - - - + + + + + + + + + + +
Font Loader (LuaTeX-Fonts)
luatex-fonts-cbk.lua luatex-basics-nod.lua
luatex-fonts-enc.lua luatex-fonts-syn.lua
luatex-font-tfm.lua luatex-font-afm.lua
luatex-font-afk.lua luatex-fonts-tfm.lua
luatex-fonts-chr.lua luatex-fonts-lua.lua
luatex-fonts-inj.lua luatex-fonts-otn.lua
luatex-fonts-def.lua luatex-fonts-ext.lua
luatex-basics-nod.lualuatex-basics-chr.lua
luatex-fonts-enc.lualuatex-fonts-syn.lua
luatex-fonts-ext.lua
>, ] @@ -341,10 +345,46 @@ strict digraph luaotfload_files { //looks weird with circo ... label = < - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Font and Node Libraries from Context
data-con.lua font-ini.lua font-con.lua
font-cid.lua font-map.lua font-oti.lua
font-otf.lua font-otb.lua font-ota.lua
font-def.lua
data-con.luafont-ini.luafont-con.lua
font-cid.luafont-map.luafont-tfm.lua
font-afm.luafont-afk.luafont-oti.lua
font-otr.luafont-cff.luafont-ttf.lua
font-dsp.luafont-oup.luafont-otl.lua
font-oto.luafont-otj.luafont-ota.lua
font-ots.luafont-osd.luafont-lua.lua
font-def.luafont-xtx.luafont-gbn.lua
>, ] -- cgit v1.2.3