From b0cb116048d189b72d15f1a6c19f0fb365e65d40 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 22 Oct 2016 19:57:52 +0200 Subject: [fontloader] sync with Context as of 2016-10-22 --- src/fontloader/misc/fontloader-font-dsp.lua | 57 +++++++++++++++++++------ src/fontloader/runtime/fontloader-reference.lua | 45 ++++++++++++++----- 2 files changed, 79 insertions(+), 23 deletions(-) diff --git a/src/fontloader/misc/fontloader-font-dsp.lua b/src/fontloader/misc/fontloader-font-dsp.lua index cd28168..14e3a1d 100644 --- a/src/fontloader/misc/fontloader-font-dsp.lua +++ b/src/fontloader/misc/fontloader-font-dsp.lua @@ -70,6 +70,7 @@ local readers = fonts.handlers.otf.readers local streamreader = readers.streamreader local setposition = streamreader.setposition +local getposition = streamreader.getposition local skipshort = streamreader.skipshort local readushort = streamreader.readcardinal2 -- 16-bit unsigned integer local readulong = streamreader.readcardinal4 -- 24-bit unsigned integer @@ -397,7 +398,7 @@ local function readlookuparray(f,noflookups,nofcurrent) end end -- if length > nofcurrent then - -- report_issue("more lookups than currently matched characters") + -- report("more lookups than currently matched characters") -- end end return lookups @@ -413,7 +414,7 @@ end -- for i=1,noflookups do -- local index = readushort(f) + 1 -- if index > nofcurrent then --- report_issue("more lookups than currently matched characters") +-- report("more lookups than currently matched characters") -- for i=nofcurrent+1,index-1 do -- lookups[i] = false -- end @@ -1285,20 +1286,50 @@ do local plugins = { } - function plugins.size(f,fontdata,tableoffset,parameters) - if not fontdata.designsize then - setposition(f,tableoffset+parameters) - local designsize = readushort(f) - if designsize > 0 then - fontdata.designsize = designsize - skipshort(f,2) - fontdata.minsize = readushort(f) - fontdata.maxsize = readushort(f) + function plugins.size(f,fontdata,tableoffset,feature) + if fontdata.designsize then + -- yes, there are fonts with multiple size entries ... it probably relates + -- to the other two fields (menu entries in some language) + else + local function check(offset) + setposition(f,offset) + local designsize = readushort(f) + if designsize > 0 then -- we could also have a threshold + local fontstyle = readushort(f) + local guimenuid = readushort(f) + local minsize = readushort(f) + local maxsize = readushort(f) + if minsize == 0 and maxsize == 0 and fontstyleid == 0 and guimenuid == 0 then + minsize = designsize + maxsize = designsize + end + if designsize >= minsize and designsize <= maxsize then + return minsize, maxsize, designsize + end + end + end + local minsize, maxsize, designsize = check(tableoffset+feature.offset+feature.parameters) + if not designsize then + -- some old adobe fonts have: tableoffset+feature.parameters and we could + -- use some heuristic but why bother ... this extra check will be removed + -- some day and/or when we run into an issue + minsize, maxsize, designsize = check(tableoffset+feature.parameters) + if designsize then + report("bad size feature in %a, falling back to wrong offset",fontdata.filename or "?") + else + report("bad size feature in %a,",fontdata.filename or "?") + end + end + if designsize then + fontdata.minsize = minsize + fontdata.maxsize = maxsize + fontdata.designsize = designsize end end end - -- feature order needs checking ... as we loop over a hash + -- feature order needs checking ... as we loop over a hash ... however, in the file + -- they are sorted so order is not that relevant local function reorderfeatures(fontdata,scripts,features) local scriptlangs = { } @@ -1440,7 +1471,7 @@ do feature.parameters = parameters local plugin = plugins[feature.tag] if plugin then - plugin(f,fontdata,offset,parameters) + plugin(f,fontdata,featureoffset,feature) end end end diff --git a/src/fontloader/runtime/fontloader-reference.lua b/src/fontloader/runtime/fontloader-reference.lua index a0b906d..287ef1a 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 : 10/19/16 22:51:32 +-- merge date : 10/22/16 10:43:17 do -- begin closure to overcome local limits and interference @@ -11398,6 +11398,7 @@ local report=logs.reporter("otf reader") local readers=fonts.handlers.otf.readers local streamreader=readers.streamreader local setposition=streamreader.setposition +local getposition=streamreader.getposition local skipshort=streamreader.skipshort local readushort=streamreader.readcardinal2 local readulong=streamreader.readcardinal4 @@ -12453,15 +12454,39 @@ function gposhandlers.extension(f,fontdata,lookupid,lookupoffset,offset,glyphs,n end do local plugins={} - function plugins.size(f,fontdata,tableoffset,parameters) - if not fontdata.designsize then - setposition(f,tableoffset+parameters) - local designsize=readushort(f) - if designsize>0 then + function plugins.size(f,fontdata,tableoffset,feature) + if fontdata.designsize then + else + local function check(offset) + setposition(f,offset) + local designsize=readushort(f) + if designsize>0 then + local fontstyle=readushort(f) + local guimenuid=readushort(f) + local minsize=readushort(f) + local maxsize=readushort(f) + if minsize==0 and maxsize==0 and fontstyleid==0 and guimenuid==0 then + minsize=designsize + maxsize=designsize + end + if designsize>=minsize and designsize<=maxsize then + return minsize,maxsize,designsize + end + end + end + local minsize,maxsize,designsize=check(tableoffset+feature.offset+feature.parameters) + if not designsize then + minsize,maxsize,designsize=check(tableoffset+feature.parameters) + if designsize then + report("bad size feature in %a, falling back to wrong offset",fontdata.filename or "?") + else + report("bad size feature in %a,",fontdata.filename or "?") + end + end + if designsize then + fontdata.minsize=minsize + fontdata.maxsize=maxsize fontdata.designsize=designsize - skipshort(f,2) - fontdata.minsize=readushort(f) - fontdata.maxsize=readushort(f) end end end @@ -12598,7 +12623,7 @@ do feature.parameters=parameters local plugin=plugins[feature.tag] if plugin then - plugin(f,fontdata,offset,parameters) + plugin(f,fontdata,featureoffset,feature) end end end -- cgit v1.2.3 From be76d78b894022622622050e3cc5fcd882b54acc Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Jan 2017 20:41:15 +0100 Subject: [log] handle logging more defensively --- src/luaotfload-log.lua | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/luaotfload-log.lua b/src/luaotfload-log.lua index 5b2f1f3..6a41590 100644 --- a/src/luaotfload-log.lua +++ b/src/luaotfload-log.lua @@ -14,6 +14,7 @@ because we lack a user interface to toggle per-subsystem tracing. --doc]]-- local module_name = "luaotfload" --- prefix for messages +local debug = debug luaotfload = luaotfload or { } luaotfload.log = luaotfload.log or { } @@ -132,10 +133,33 @@ end log.set_logout = set_logout +local format_error_handler +if debug then + local debugtraceback = debug.traceback + format_error_handler = function (err) + print "" + print (stringformat ("luaotfload error: %q", err)) + print (stringformat ("Lua interpreter %s", debugtraceback ())) + print "" + end +else + format_error_handler = function (err) + print "" + print (stringformat ("luaotfload error: %q", err)) + print "Lua debug module not available; please enable for a backtrace" + print "" + end +end + local basic_logger = function (category, fmt, ...) - local res = { module_name, "|", category, ":" } + local res = { module_name, "|", category or "UNKNOWN", ":" } if fmt then - res [#res + 1] = stringformat (fmt, ...) + local ok, val = xpcall (stringformat, format_error_handler, fmt, ...) + if ok then + res [#res + 1] = val + else + res [#res + 1] = stringformat ("ERROR: %q", val) + end end texiowrite_nl (logout, tableconcat(res, " ")) end @@ -354,4 +378,4 @@ local texioreporter = function (message) end texio.reporter = texioreporter - +--- vim:shiftwidth=4:expandtab:ft=lua -- cgit v1.2.3 From d87cbe82a683b13674ad8e943a638d4f0f62cb3b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 01:09:08 +0100 Subject: [letterspace] address node deallocation issues With 1.0.3 the test pln-letterspace-12-double-ligature-issue-350.tex causes a crash on account of a double free. Remove the code that calls nodedirect.free() on the removed nodes until this is better understood. --- src/luaotfload-letterspace.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/luaotfload-letterspace.lua b/src/luaotfload-letterspace.lua index 78df1d7..5a56d31 100644 --- a/src/luaotfload-letterspace.lua +++ b/src/luaotfload-letterspace.lua @@ -61,7 +61,11 @@ local todirect = nodedirect.tonut local tonode = nodedirect.tonode local insert_node_before = nodedirect.insert_before -local free_node = nodedirect.free +local free_node = nodedirect.free -- may cause double free +local free_node = function (n) + logreport ("term", 5, "letterspace", "not calling free_node(%d)", n) + -- free_node (n) +end local copy_node = nodedirect.copy local new_node = nodedirect.new @@ -348,7 +352,7 @@ kerncharacters = function (head) end start = c setfield(s, "components", nil) - --free_node(s) --> double free with multipart components + free_node(s) --> double free with multipart components c = getfield (start, "components") end end -- cgit v1.2.3 From 4f516d56e3e1d447e95676c1dd2c95362ed77840 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 01:18:34 +0100 Subject: [fontloader] sync with Context as of 2017-01-29 --- src/fontloader/misc/fontloader-font-oto.lua | 4 +- src/fontloader/misc/fontloader-font-otr.lua | 6 +- src/fontloader/misc/fontloader-font-ots.lua | 4 +- src/fontloader/misc/fontloader-font-oup.lua | 35 ++++++++-- src/fontloader/misc/fontloader-l-string.lua | 12 ++-- src/fontloader/misc/fontloader-l-table.lua | 46 ++++++++++++- src/fontloader/runtime/fontloader-reference.lua | 90 +++++++++++++++++++++---- 7 files changed, 165 insertions(+), 32 deletions(-) diff --git a/src/fontloader/misc/fontloader-font-oto.lua b/src/fontloader/misc/fontloader-font-oto.lua index 177382f..1356879 100644 --- a/src/fontloader/misc/fontloader-font-oto.lua +++ b/src/fontloader/misc/fontloader-font-oto.lua @@ -237,12 +237,12 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis if kind == "gsub_single" then for i=1,#steps do for unicode, data in next, steps[i].coverage do - if not changed[unicode] then + -- if not changed[unicode] then -- fails for multiple subs in some math fonts if trace_singles then report_substitution(feature,sequence,descriptions,unicode,data) end changed[unicode] = data - end + -- end end end elseif kind == "gsub_alternate" then diff --git a/src/fontloader/misc/fontloader-font-otr.lua b/src/fontloader/misc/fontloader-font-otr.lua index 2b18c1e..a9d3a8b 100644 --- a/src/fontloader/misc/fontloader-font-otr.lua +++ b/src/fontloader/misc/fontloader-font-otr.lua @@ -645,7 +645,7 @@ local weights = { [300] = "light", [400] = "normal", [500] = "medium", - [600] = "semibold", + [600] = "semibold", -- demi demibold [700] = "bold", [800] = "extrabold", [900] = "black", @@ -1843,8 +1843,8 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo) local fontheader = fontdata.fontheader or { } local cffinfo = fontdata.cffinfo or { } local filename = fontdata.filename - local weight = getname(fontdata,"weight") or cffinfo.weight or metrics.weight - local width = getname(fontdata,"width") or cffinfo.width or metrics.width + local weight = getname(fontdata,"weight") or (cffinfo and cffinfo.weight) or (metrics and metrics.weight) + local width = getname(fontdata,"width") or (cffinfo and cffinfo.width ) or (metrics and metrics.width ) local fontname = getname(fontdata,"postscriptname") local fullname = getname(fontdata,"fullname") local family = getname(fontdata,"family") diff --git a/src/fontloader/misc/fontloader-font-ots.lua b/src/fontloader/misc/fontloader-font-ots.lua index 17e1a3c..1f84214 100644 --- a/src/fontloader/misc/fontloader-font-ots.lua +++ b/src/fontloader/misc/fontloader-font-ots.lua @@ -244,6 +244,8 @@ local registerotffeature = otffeatures.register local onetimemessage = fonts.loggers.onetimemessage or function() end +local getrandom = utilities and utilities.randomizer and utilities.randomizer.get + otf.defaultnodealternate = "none" -- first last -- We use a few global variables. The handler can be called nested but this assumes that the @@ -653,7 +655,7 @@ end local function get_alternative_glyph(start,alternatives,value) local n = #alternatives if value == "random" then - local r = random(1,n) + local r = getrandom and getrandom("glyph",1,n) or random(1,n) return alternatives[r], trace_alternatives and formatters["value %a, taking %a"](value,r) elseif value == "first" then return alternatives[1], trace_alternatives and formatters["value %a, taking %a"](value,1) diff --git a/src/fontloader/misc/fontloader-font-oup.lua b/src/fontloader/misc/fontloader-font-oup.lua index c494573..cfa90c7 100644 --- a/src/fontloader/misc/fontloader-font-oup.lua +++ b/src/fontloader/misc/fontloader-font-oup.lua @@ -29,7 +29,12 @@ local f_index = formatters["I%05X"] local f_character_y = formatters["%C"] local f_character_n = formatters["[ %C ]"] -local doduplicates = true -- can become an option (pseudo feature) +local check_duplicates = true -- can become an option (pseudo feature) / aways needed anyway +local check_soft_hyphen = false -- can become an option (pseudo feature) / needed for tagging + +directives.register("otf.checksofthyphen",function(v) + check_soft_hyphen = v +end) local function replaced(list,index,replacement) if type(list) == "number" then @@ -106,7 +111,7 @@ local function unifyresources(fontdata,indices) -- local done = { } -- we need to deal with shared ! -- - local duplicates = doduplicates and resources.duplicates + local duplicates = check_duplicates and resources.duplicates if duplicates and not next(duplicates) then duplicates = false end @@ -359,12 +364,34 @@ local function unifyresources(fontdata,indices) end local function copyduplicates(fontdata) - if doduplicates then + if check_duplicates then local descriptions = fontdata.descriptions local resources = fontdata.resources local duplicates = resources.duplicates + if check_soft_hyphen then + -- ebgaramond has a zero width empty soft hyphen + local ds = descriptions[0xAD] + if not ds or ds.width == 0 then + if ds then + descriptions[0xAD] = nil + report("patching soft hyphen") + else + report("adding soft hyphen") + end + if not duplicates then + duplicates = { } + resources.duplicates = duplicates + end + local dh = duplicates[0x2D] + if dh then + dh[#dh+1] = { [0xAD] = true } + else + duplicates[0x2D] = { [0xAD] = true } + end + end + end if duplicates then - for u, d in next, duplicates do + for u, d in next, duplicates do local du = descriptions[u] if du then local t = { f_character_y(u), "@", f_index(du.index), "->" } diff --git a/src/fontloader/misc/fontloader-l-string.lua b/src/fontloader/misc/fontloader-l-string.lua index 88297f2..be8f397 100644 --- a/src/fontloader/misc/fontloader-l-string.lua +++ b/src/fontloader/misc/fontloader-l-string.lua @@ -75,19 +75,19 @@ local collapser = patterns.collapser local longtostring = patterns.longtostring function string.strip(str) - return lpegmatch(stripper,str) or "" + return str and lpegmatch(stripper,str) or "" end function string.fullstrip(str) - return lpegmatch(fullstripper,str) or "" + return str and lpegmatch(fullstripper,str) or "" end function string.collapsespaces(str) - return lpegmatch(collapser,str) or "" + return str and lpegmatch(collapser,str) or "" end function string.longtostring(str) - return lpegmatch(longtostring,str) or "" + return str and lpegmatch(longtostring,str) or "" end -- function string.is_empty(str) @@ -99,7 +99,7 @@ local pattern = P(" ")^0 * P(-1) -- maybe also newlines -- patterns.onlyspaces = pattern function string.is_empty(str) - if str == "" then + if not str or str == "" then return true else return lpegmatch(pattern,str) and true or false @@ -163,7 +163,7 @@ function string.escapedpattern(str,simple) end function string.topattern(str,lowercase,strict) - if str=="" or type(str) ~= "string" then + if str == "" or type(str) ~= "string" then return ".*" elseif strict then str = lpegmatch(pattern_c,str) diff --git a/src/fontloader/misc/fontloader-l-table.lua b/src/fontloader/misc/fontloader-l-table.lua index 498f518..39357bd 100644 --- a/src/fontloader/misc/fontloader-l-table.lua +++ b/src/fontloader/misc/fontloader-l-table.lua @@ -971,6 +971,41 @@ end table.flattened = flattened +local function collapsed(t,f,h) + if f == nil then + f = { } + h = { } + end + for k=1,#t do + local v = t[k] + if type(v) == "table" then + collapsed(v,f,h) + elseif not h[v] then + f[#f+1] = v + h[v] = true + end + end + return f +end + +local function collapsedhash(t,h) + if h == nil then + h = { } + end + for k=1,#t do + local v = t[k] + if type(v) == "table" then + collapsedhash(v,h) + else + h[v] = true + end + end + return h +end + +table.collapsed = collapsed -- 20% faster than unique(collapsed(t)) +table.collapsedhash = collapsedhash + local function unnest(t,f) -- only used in mk, for old times sake if not f then -- and only relevant for token lists f = { } -- this one can become obsolete @@ -1077,7 +1112,7 @@ function table.count(t) return n end -function table.swapped(t,s) -- hash +function table.swapped(t,s) -- hash, we need to make sure we don't mess up next local n = { } if s then for k, v in next, s do @@ -1090,7 +1125,14 @@ function table.swapped(t,s) -- hash return n end -function table.mirrored(t) -- hash +function table.hashed(t) -- list, add hash to index (save because we are not yet mixed + for i=1,#t do + t[t[i]] = i + end + return t +end + +function table.mirrored(t) -- hash, we need to make sure we don't mess up next local n = { } for k, v in next, t do n[v] = k diff --git a/src/fontloader/runtime/fontloader-reference.lua b/src/fontloader/runtime/fontloader-reference.lua index 287ef1a..3a4a70c 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 : 10/22/16 10:43:17 +-- merge date : 01/27/17 14:39:39 do -- begin closure to overcome local limits and interference @@ -964,20 +964,20 @@ local fullstripper=patterns.fullstripper local collapser=patterns.collapser local longtostring=patterns.longtostring function string.strip(str) - return lpegmatch(stripper,str) or "" + return str and lpegmatch(stripper,str) or "" end function string.fullstrip(str) - return lpegmatch(fullstripper,str) or "" + return str and lpegmatch(fullstripper,str) or "" end function string.collapsespaces(str) - return lpegmatch(collapser,str) or "" + return str and lpegmatch(collapser,str) or "" end function string.longtostring(str) - return lpegmatch(longtostring,str) or "" + return str and lpegmatch(longtostring,str) or "" end local pattern=P(" ")^0*P(-1) function string.is_empty(str) - if str=="" then + if not str or str=="" then return true else return lpegmatch(pattern,str) and true or false @@ -1739,6 +1739,38 @@ local function flattened(t,f,depth) return f end table.flattened=flattened +local function collapsed(t,f,h) + if f==nil then + f={} + h={} + end + for k=1,#t do + local v=t[k] + if type(v)=="table" then + collapsed(v,f,h) + elseif not h[v] then + f[#f+1]=v + h[v]=true + end + end + return f +end +local function collapsedhash(t,h) + if h==nil then + h={} + end + for k=1,#t do + local v=t[k] + if type(v)=="table" then + collapsedhash(v,h) + else + h[v]=true + end + end + return h +end +table.collapsed=collapsed +table.collapsedhash=collapsedhash local function unnest(t,f) if not f then f={} @@ -1845,6 +1877,12 @@ function table.swapped(t,s) end return n end +function table.hashed(t) + for i=1,#t do + t[t[i]]=i + end + return t +end function table.mirrored(t) local n={} for k,v in next,t do @@ -9054,8 +9092,8 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo) local fontheader=fontdata.fontheader or {} local cffinfo=fontdata.cffinfo or {} local filename=fontdata.filename - local weight=getname(fontdata,"weight") or cffinfo.weight or metrics.weight - local width=getname(fontdata,"width") or cffinfo.width or metrics.width + local weight=getname(fontdata,"weight") or (cffinfo and cffinfo.weight) or (metrics and metrics.weight) + local width=getname(fontdata,"width") or (cffinfo and cffinfo.width ) or (metrics and metrics.width ) local fontname=getname(fontdata,"postscriptname") local fullname=getname(fontdata,"fullname") local family=getname(fontdata,"family") @@ -13534,7 +13572,11 @@ local f_unicode=formatters["U%05X"] local f_index=formatters["I%05X"] local f_character_y=formatters["%C"] local f_character_n=formatters["[ %C ]"] -local doduplicates=true +local check_duplicates=true +local check_soft_hyphen=false +directives.register("otf.checksofthyphen",function(v) + check_soft_hyphen=v +end) local function replaced(list,index,replacement) if type(list)=="number" then return replacement @@ -13602,7 +13644,7 @@ local function unifyresources(fontdata,indices) end end local done={} - local duplicates=doduplicates and resources.duplicates + local duplicates=check_duplicates and resources.duplicates if duplicates and not next(duplicates) then duplicates=false end @@ -13839,10 +13881,31 @@ local function unifyresources(fontdata,indices) unifythem(resources.sublookups) end local function copyduplicates(fontdata) - if doduplicates then + if check_duplicates then local descriptions=fontdata.descriptions local resources=fontdata.resources local duplicates=resources.duplicates + if check_soft_hyphen then + local ds=descriptions[0xAD] + if not ds or ds.width==0 then + if ds then + descriptions[0xAD]=nil + report("patching soft hyphen") + else + report("adding soft hyphen") + end + if not duplicates then + duplicates={} + resources.duplicates=duplicates + end + local dh=duplicates[0x2D] + if dh then + dh[#dh+1]={ [0xAD]=true } + else + duplicates[0x2D]={ [0xAD]=true } + end + end + end if duplicates then for u,d in next,duplicates do local du=descriptions[u] @@ -16351,12 +16414,10 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis if kind=="gsub_single" then for i=1,#steps do for unicode,data in next,steps[i].coverage do - if not changed[unicode] then if trace_singles then report_substitution(feature,sequence,descriptions,unicode,data) end changed[unicode]=data - end end end elseif kind=="gsub_alternate" then @@ -18401,6 +18462,7 @@ local fontfeatures=fonthashes.features local otffeatures=fonts.constructors.features.otf local registerotffeature=otffeatures.register local onetimemessage=fonts.loggers.onetimemessage or function() end +local getrandom=utilities and utilities.randomizer and utilities.randomizer.get otf.defaultnodealternate="none" local tfmdata=false local characters=false @@ -18746,7 +18808,7 @@ end local function get_alternative_glyph(start,alternatives,value) local n=#alternatives if value=="random" then - local r=random(1,n) + local r=getrandom and getrandom("glyph",1,n) or random(1,n) return alternatives[r],trace_alternatives and formatters["value %a, taking %a"](value,r) elseif value=="first" then return alternatives[1],trace_alternatives and formatters["value %a, taking %a"](value,1) -- cgit v1.2.3 From 17a5da03053805591b11e960d0126db7f1ba4184 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 17:24:13 +0100 Subject: [doc] update instructions for install target Fix #393 Credits to @rpspringuel for pointing this out. --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 01e1fc6..77b2864 100644 --- a/README +++ b/README @@ -56,7 +56,7 @@ Here are the recommended installation methods (preferred first). distribution's manual for details. 3. a. Grab the sources from CTAN or github. - b. Run 'make install TEXMFROOT=/path/to/texmf'. + b. Run 'make install DESTDIR=/path/to/texmf'. c. See 2c. 4. Try to figure it out by looking at the Makefile and comments in the sources. -- cgit v1.2.3 From 0baccc9623891f57a302d51d40a3d1c380d910d0 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 17:47:57 +0100 Subject: [main] make main() no-op when called again Fix #390 Suggested by @davidcarlisle. --- src/luaotfload-main.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index 83ce5e7..bbe09fa 100644 --- a/src/luaotfload-main.lua +++ b/src/luaotfload-main.lua @@ -246,8 +246,18 @@ local install_loaders = function () return loaders end +local luaotfload_initialized = false --- prevent multiple invocations + luaotfload.main = function () + if luaotfload_initialized then + logreport ("log", 0, "load", + "Luaotfload initialization requested but is already \z + loaded, ignoring.") + return + end + luaotfload_initialized = true + luaotfload.loaders = install_loaders () local loaders = luaotfload.loaders local loadmodule = loaders.luaotfload -- cgit v1.2.3 From 6b324ecd8b9f092e93ca12390ab4378ebe18dfe6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 18:17:06 +0100 Subject: [db] scale optical sizes to pt Fix #389 --- src/luaotfload-database.lua | 54 +++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index c6ccaa6..d0a2420 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -520,7 +520,7 @@ load_names = function (dry_run, no_rebuild) names_version = names.version if db_version ~= names_version then logreport ("both", 0, "db", - [[Version mismatch; expected %4.3f, got %4.3f.]], + [[Version mismatch; expected %d, got %d.]], names_version, db_version) if not fonts_reloaded then logreport ("both", 0, "db", [[Force rebuild.]]) @@ -1322,28 +1322,40 @@ local load_font_file = function (filename, subfont) return ret end ---- rawdata -> (int * int * int | bool) +local get_size_info do --- too many upvalues :/ + local design_dimension_bp = true + local pt, bp = 7227.0, 7200.0 -local get_size_info = function (rawinfo) - local design_size = rawinfo.design_size - local design_range_top = rawinfo.design_range_top - local design_range_bottom = rawinfo.design_range_bottom + --- rawdata -> (int * int * int | bool) - local fallback_size = design_size ~= 0 and design_size - or design_range_bottom ~= 0 and design_range_bottom - or design_range_top ~= 0 and design_range_top + get_size_info = function (rawinfo) + local design_size = rawinfo.design_size + local design_range_top = rawinfo.design_range_top + local design_range_bottom = rawinfo.design_range_bottom - if fallback_size then - design_size = (design_size or fallback_size) / 10 - design_range_top = (design_range_top or fallback_size) / 10 - design_range_bottom = (design_range_bottom or fallback_size) / 10 - return { - design_size, design_range_top, design_range_bottom, - } - end + local fallback_size = design_size ~= 0 and design_size + or design_range_bottom ~= 0 and design_range_bottom + or design_range_top ~= 0 and design_range_top - return false -end + if fallback_size then + design_size = (design_size or fallback_size) / 10 + design_range_top = (design_range_top or fallback_size) / 10 + design_range_bottom = (design_range_bottom or fallback_size) / 10 + + if design_dimension_bp == true then + design_size = (design_size * bp) / pt + design_range_top = (design_range_top * bp) / pt + design_range_bottom = (design_range_bottom * bp) / pt + end + + return { + design_size, design_range_top, design_range_bottom, + } + end + + return false + end +end ---[local get_size_info] --[[doc-- map_enlish_names -- Names-table for Lua fontloader objects. This @@ -2605,7 +2617,7 @@ do polluting the lookup table. What doesn’t work is, e. g. treating weights > 500 as bold or allowing synonyms like “heavy”, “black”. - --]]-- + --]]-- if width == normal_width then if pfmweight == bold_weight then --- bold spectrum matches @@ -3599,7 +3611,7 @@ return { fonts.definers = fonts.definers or { resolvers = { } } names.blacklist = blacklist - names.version = 2.9 + names.version = 3 --- increase monotonically names.data = nil --- contains the loaded database names.lookups = nil --- contains the lookup cache -- cgit v1.2.3 From bf4d896671075aaee73fd7826f66fd179112011c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 19:04:33 +0100 Subject: [conf,db] make design size dimension configurable --- src/luaotfload-configuration.lua | 49 ++++++++++++++++++++++++++++++++++------ src/luaotfload-database.lua | 39 ++++++++++++++++++++++++++------ 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index 8484c62..46e9074 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -92,6 +92,11 @@ local valid_formats = tabletohash { "otf", "ttc", "ttf", "afm", "pfb" } +--- cf. TeXbook p. 57 +local valid_designsize_dimens = tabletohash { + "bp", "pt", "dd" +} + local default_anon_sequence = { "tex", "path", "name" } @@ -203,6 +208,7 @@ local default_config = { update_live = true, compress = true, max_fonts = 2^51, + designsize_dimen= "bp", }, run = { anon_sequence = default_anon_sequence, @@ -314,6 +320,18 @@ local set_font_filter = function () return true end +local set_size_dimension = function () + local names = fonts.names + if names and names.size_dimension then + local dim = config.luaotfload.db.designsize_dimen + if not dim or dim == "" then + dim = default_config.db.designsize_dimen + end + names.set_size_dimension (dim) + end + return true +end + local set_name_resolver = function () local names = fonts.names if names and names.resolve_cached then @@ -382,6 +400,7 @@ reconf_tasks = { { "Build cache paths" , build_cache_paths }, { "Check terminal dimensions" , check_termwidth }, { "Set the font filter" , set_font_filter }, + { "Set design size dimension" , set_size_dimension }, { "Install font name resolver", set_name_resolver }, { "Set default features" , set_default_features }, } @@ -482,6 +501,21 @@ local option_spec = { out_t = number_t, --- TODO int_t from 5.3.x on transform = tointeger, }, + designsize_dimen = { + in_t = string_t, + out_t = string_t, + transform = function (dim) + if not valid_designsize_dimens [dim] then + local default = valid_designsize_dimens.__default + logreport ("both", 0, "conf", + "Invalid dimension %q specified for design sizes, \z + using default %q.", dim, default) + return default + end + logreport ("both", 4, "conf", "Chosen design size dimension %q.", dim) + return dim + end + }, }, run = { anon_sequence = { @@ -698,13 +732,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 }, + designsize_dimen = { false, format_string }, + 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 }, }, default_features = { __default = { true, format_keyval }, diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index d0a2420..5750966 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -162,7 +162,6 @@ local tablesort = table.sort local utf8gsub = unicode.utf8.gsub local utf8lower = unicode.utf8.lower local utf8len = unicode.utf8.len -local zlibcompress = zlib.compress --- these come from Lualibs/Context local filebasename = file.basename @@ -1322,9 +1321,34 @@ local load_font_file = function (filename, subfont) return ret end -local get_size_info do --- too many upvalues :/ - local design_dimension_bp = true - local pt, bp = 7227.0, 7200.0 +local set_size_dimension +local get_size_info +do --- too many upvalues :/ + --- cf. TeXbook p. 57 + local dimens = { + pt = function (v) return v end, + bp = function (v) return (v * 7200.0) / 7227.0 end, + dd = function (v) return (v * 1157.0) / 1238.0 end, + } + + local dimen_pt = 1 + local dimen_bp = 2 + local dimen_dd = 3 + + local size_dimen = dimens.bp + local set_size_dimen = function (dim) + local f = dimens [dim] + if f then + logreport ("both", 4, "db", + "Interpreting design sizes as %q, factor %.6f.", + dim, f (1.000000)) + size_dimen = f + return + end + logreport ("both", 0, "db", + "Invalid dimension %q requested for design sizes; \z + ignoring.") + end --- rawdata -> (int * int * int | bool) @@ -1343,9 +1367,9 @@ local get_size_info do --- too many upvalues :/ design_range_bottom = (design_range_bottom or fallback_size) / 10 if design_dimension_bp == true then - design_size = (design_size * bp) / pt - design_range_top = (design_range_top * bp) / pt - design_range_bottom = (design_range_bottom * bp) / pt + design_size = size_dimen (design_size ) + design_range_top = size_dimen (design_range_top ) + design_range_bottom = size_dimen (design_range_bottom) end return { @@ -3572,6 +3596,7 @@ local api = { local export = { set_font_filter = set_font_filter, + set_size_dimension = set_size_dimension, flush_lookup_cache = flush_lookup_cache, save_lookups = save_lookups, load = load_names, -- cgit v1.2.3 From d83a7f05a09947bbc874464e65dd44ec16b8b066 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 19:10:54 +0100 Subject: [doc] mention the designsize-dimen option in manpage --- doc/luaotfload.conf.rst | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/doc/luaotfload.conf.rst b/doc/luaotfload.conf.rst index 2af9cec..92c1e31 100644 --- a/doc/luaotfload.conf.rst +++ b/doc/luaotfload.conf.rst @@ -125,23 +125,25 @@ the variable is unset. Section ``db`` ----------------------------------------------------------------------- -+-----------------+--------+---------------------------+ -| variable | type | default | -+-----------------+--------+---------------------------+ -| compress | b | ``true`` | -+-----------------+--------+---------------------------+ -| formats | s | ``"otf,ttf,ttc"`` | -+-----------------+--------+---------------------------+ -| 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`` | ++--------------------+--------+---------------------------+ +| designsize-dimen | b | ``bp`` | ++--------------------+--------+---------------------------+ +| formats | s | ``"otf,ttf,ttc"`` | ++--------------------+--------+---------------------------+ +| max-fonts | n | ``2^51`` | ++--------------------+--------+---------------------------+ +| scan-local | b | ``false`` | ++--------------------+--------+---------------------------+ +| skip-read | b | ``false`` | ++--------------------+--------+---------------------------+ +| strip | b | ``true`` | ++--------------------+--------+---------------------------+ +| update-live | b | ``true`` | ++--------------------+--------+---------------------------+ The flag ``compress`` determines whether the font index (usually ``luaotfload-names.lua[.gz]`` will be stored in compressed forms. @@ -150,6 +152,10 @@ If unset it is equivalent of passing ``--no-compress`` to and has no effect on the runtime behavior of Luaotfload, the flag should remain set. Most editors come with zlib support anyways. +The setting ``designsize-dimen`` applies when looking up fonts from +families with design sizes. The default of DTP-style “big points” +can be changed for ``pt`` or even ``dd``. + The list of ``formats`` must be a comma separated sequence of strings containing one or more of these elements: -- cgit v1.2.3 From 2ba3fdfa6207c9c4f61fee1d5518f271c19aa891 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 19:21:06 +0100 Subject: [conf] improve defaults handling of designsize-dimen --- src/luaotfload-configuration.lua | 18 +----------------- src/luaotfload-database.lua | 10 ++++------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index 46e9074..4d918b2 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -92,11 +92,6 @@ local valid_formats = tabletohash { "otf", "ttc", "ttf", "afm", "pfb" } ---- cf. TeXbook p. 57 -local valid_designsize_dimens = tabletohash { - "bp", "pt", "dd" -} - local default_anon_sequence = { "tex", "path", "name" } @@ -322,7 +317,7 @@ end local set_size_dimension = function () local names = fonts.names - if names and names.size_dimension then + if names and names.set_size_dimension then local dim = config.luaotfload.db.designsize_dimen if not dim or dim == "" then dim = default_config.db.designsize_dimen @@ -504,17 +499,6 @@ local option_spec = { designsize_dimen = { in_t = string_t, out_t = string_t, - transform = function (dim) - if not valid_designsize_dimens [dim] then - local default = valid_designsize_dimens.__default - logreport ("both", 0, "conf", - "Invalid dimension %q specified for design sizes, \z - using default %q.", dim, default) - return default - end - logreport ("both", 4, "conf", "Chosen design size dimension %q.", dim) - return dim - end }, }, run = { diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index 5750966..14fe4b3 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -1336,7 +1336,7 @@ do --- too many upvalues :/ local dimen_dd = 3 local size_dimen = dimens.bp - local set_size_dimen = function (dim) + set_size_dimension = function (dim) local f = dimens [dim] if f then logreport ("both", 4, "db", @@ -1366,11 +1366,9 @@ do --- too many upvalues :/ design_range_top = (design_range_top or fallback_size) / 10 design_range_bottom = (design_range_bottom or fallback_size) / 10 - if design_dimension_bp == true then - design_size = size_dimen (design_size ) - design_range_top = size_dimen (design_range_top ) - design_range_bottom = size_dimen (design_range_bottom) - end + design_size = size_dimen (design_size ) + design_range_top = size_dimen (design_range_top ) + design_range_bottom = size_dimen (design_range_bottom) return { design_size, design_range_top, design_range_bottom, -- cgit v1.2.3 From 40d45da8c22aa1699c3b62989eb881e5e2c67467 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 19:46:29 +0100 Subject: [db] move design size handling into lookup Store design sizes in sp in index. Lookups are performed using sp so the design size factor can be applied at runtime. --- src/luaotfload-database.lua | 89 +++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index 14fe4b3..66755d3 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -111,7 +111,7 @@ if not modules then modules = { } end modules ['luaotfload-database'] = { --doc]]-- local lpeg = require "lpeg" -local P, Cc, lpegmatch = lpeg.P, lpeg.Cc, lpeg.match +local P, lpegmatch = lpeg.P, lpeg.match local log = luaotfload.log local logreport = log and log.report or print -- overriden later on @@ -890,8 +890,9 @@ end --[[doc-- - choose_size -- Pick a font face of appropriate size from the list - of family members with matching style. There are three categories: + choose_size -- Pick a font face of appropriate size (in sp) from + the list of family members with matching style. There are three + categories: 1. exact matches: if there is a face whose design size equals the asked size, it is returned immediately and no further @@ -1041,6 +1042,35 @@ local lookup_fontname = function (specification, name, style) return nil, nil end +local design_size_dimension +local set_size_dimension +do + + --- cf. TeXbook p. 57 + local dimens = { + pt = function (v) return v end, + bp = function (v) return (v * 7200) / 7227 end, + dd = function (v) return (v * 1157) / 1238 end, + } + + design_size_dimension = dimens.bp + + set_size_dimension = function (dim) + local f = dimens [dim] + if f then + logreport ("both", 4, "db", + "Interpreting design sizes as %q, factor %.6f.", + dim, f (1.000000)) + design_size_dimension = f + return + end + logreport ("both", 0, "db", + "Invalid dimension %q requested for design sizes; \z + ignoring.") + end +end + + --[[doc-- lookup_font_name -- Perform a name: lookup. This first queries the @@ -1098,15 +1128,14 @@ lookup_font_name = function (specification) local askedsize = specification.optsize if askedsize then - askedsize = tonumber (askedsize) + askedsize = tonumber (askedsize) * 65536 else askedsize = specification.size - if askedsize and askedsize >= 0 then - askedsize = askedsize / 65536 - else + if not askedsize or askedsize < 0 then askedsize = 0 end end + askedsize = design_size_dimension (askedsize) resolved, subfont = lookup_familyname (specification, name, @@ -1321,35 +1350,7 @@ local load_font_file = function (filename, subfont) return ret end -local set_size_dimension -local get_size_info -do --- too many upvalues :/ - --- cf. TeXbook p. 57 - local dimens = { - pt = function (v) return v end, - bp = function (v) return (v * 7200.0) / 7227.0 end, - dd = function (v) return (v * 1157.0) / 1238.0 end, - } - - local dimen_pt = 1 - local dimen_bp = 2 - local dimen_dd = 3 - - local size_dimen = dimens.bp - set_size_dimension = function (dim) - local f = dimens [dim] - if f then - logreport ("both", 4, "db", - "Interpreting design sizes as %q, factor %.6f.", - dim, f (1.000000)) - size_dimen = f - return - end - logreport ("both", 0, "db", - "Invalid dimension %q requested for design sizes; \z - ignoring.") - end - +local get_size_info do --- too many upvalues :/ --- rawdata -> (int * int * int | bool) get_size_info = function (rawinfo) @@ -1362,13 +1363,13 @@ do --- too many upvalues :/ or design_range_top ~= 0 and design_range_top if fallback_size then - design_size = (design_size or fallback_size) / 10 - design_range_top = (design_range_top or fallback_size) / 10 - design_range_bottom = (design_range_bottom or fallback_size) / 10 + design_size = ((design_size or fallback_size) * 2^16) / 10 + design_range_top = ((design_range_top or fallback_size) * 2^16) / 10 + design_range_bottom = ((design_range_bottom or fallback_size) * 2^16) / 10 - design_size = size_dimen (design_size ) - design_range_top = size_dimen (design_range_top ) - design_range_bottom = size_dimen (design_range_bottom) + design_size = (design_size * 7200) / 7227 + design_range_top = (design_range_top * 7200) / 7227 + design_range_bottom = (design_range_bottom * 7200) / 7227 return { design_size, design_range_top, design_range_bottom, @@ -1947,7 +1948,7 @@ local create_blacklist = function (blacklist, whitelist) if p_blacklist == nil then --- always return false - p_blacklist = Cc(false) + p_blacklist = lpeg.Cc(false) end return result @@ -3634,7 +3635,7 @@ return { fonts.definers = fonts.definers or { resolvers = { } } names.blacklist = blacklist - names.version = 3 --- increase monotonically + names.version = 4 --- increase monotonically names.data = nil --- contains the loaded database names.lookups = nil --- contains the lookup cache -- cgit v1.2.3 From bd12d9f212aa698034bfcf6dffe21444d992e1fa Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 20:18:57 +0100 Subject: [*] update news --- NEWS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS b/NEWS index f558e3b..83ac5c2 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,13 @@ Change History -------------- +2017-01-29, luaotfload v2.8: + * Latest fontloader code. + * Support for Luatex 1.0. + * Integration of the extended AFM handler. + * Fixes to font family assignment. + * Skip initialization if Luaotfload is already loaded. + * Optical sizes advertised by fonts treated as big points. + 2016/04/21, luaotfload v2.7: * Rework lookup chaining. * Combining glyphs from different fonts (``combo: ...`` requests). -- cgit v1.2.3 From 31831b966ec0bef1bd1068fc8eb5db80dfae2ea2 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 20:24:22 +0100 Subject: [*] bump year and version --- doc/luaotfload-main.tex | 4 ++-- doc/luaotfload-tool.rst | 4 ++-- doc/luaotfload.conf.rst | 4 ++-- src/luaotfload-auxiliary.lua | 5 +---- src/luaotfload-colors.lua | 2 +- src/luaotfload-configuration.lua | 4 ++-- src/luaotfload-database.lua | 2 +- src/luaotfload-letterspace.lua | 2 +- src/luaotfload-log.lua | 2 +- src/luaotfload-main.lua | 4 ++-- src/luaotfload-parsers.lua | 2 +- src/luaotfload.sty | 4 ++-- 12 files changed, 18 insertions(+), 21 deletions(-) diff --git a/doc/luaotfload-main.tex b/doc/luaotfload-main.tex index 406595a..c26235e 100644 --- a/doc/luaotfload-main.tex +++ b/doc/luaotfload-main.tex @@ -1,4 +1,4 @@ -%% Copyright (C) 2009-2016 +%% Copyright (C) 2009-2017 %% %% by Elie Roux %% and Khaled Hosny @@ -32,7 +32,7 @@ \beginfrontmatter \setdocumenttitle {The \identifier{luaotfload} package} - \setdocumentdate {2016/06/16 v2.7} + \setdocumentdate {2017/01/29 v2.8} \setdocumentauthor {Elie Roux · Khaled Hosny · Philipp Gesang\\ Home: \hyperlink {https://github.com/lualatex/luaotfload}\\ Support: \email {lualatex-dev@tug.org}} diff --git a/doc/luaotfload-tool.rst b/doc/luaotfload-tool.rst index 28f8e00..1eeba11 100644 --- a/doc/luaotfload-tool.rst +++ b/doc/luaotfload-tool.rst @@ -6,9 +6,9 @@ generate and query the Luaotfload font names database ----------------------------------------------------------------------- -:Date: 2016-06-16 +:Date: 2017-01-28 :Copyright: GPL v2.0 -:Version: 2.7 +:Version: 2.8 :Manual section: 1 :Manual group: text processing diff --git a/doc/luaotfload.conf.rst b/doc/luaotfload.conf.rst index 92c1e31..fbef8ec 100644 --- a/doc/luaotfload.conf.rst +++ b/doc/luaotfload.conf.rst @@ -6,9 +6,9 @@ Luaotfload configuration file ----------------------------------------------------------------------- -:Date: 2016-06-16 +:Date: 2017-01-29 :Copyright: GPL v2.0 -:Version: 2.7 +:Version: 2.8 :Manual section: 5 :Manual group: text processing diff --git a/src/luaotfload-auxiliary.lua b/src/luaotfload-auxiliary.lua index 1a21405..395f9b5 100644 --- a/src/luaotfload-auxiliary.lua +++ b/src/luaotfload-auxiliary.lua @@ -2,14 +2,11 @@ ----------------------------------------------------------------------- -- FILE: luaotfload-auxiliary.lua -- DESCRIPTION: part of luaotfload --- REQUIREMENTS: luaotfload 2.7 +-- REQUIREMENTS: luaotfload 2.8 -- AUTHOR: Khaled Hosny, Élie Roux, Philipp Gesang ----------------------------------------------------------------------- -- ---- this file addresses issue #24 ---- https://github.com/lualatex/luaotfload/issues/24# - luaotfload = luaotfload or { } local log = luaotfload.log local logreport = log.report diff --git a/src/luaotfload-colors.lua b/src/luaotfload-colors.lua index 12b490e..f2fdceb 100644 --- a/src/luaotfload-colors.lua +++ b/src/luaotfload-colors.lua @@ -1,5 +1,5 @@ if not modules then modules = { } end modules ['luaotfload-colors'] = { - version = "2.7", + version = "2.8", comment = "companion to luaotfload-main.lua (font color)", author = "Khaled Hosny, Elie Roux, Philipp Gesang, Dohyun Kim, David Carlisle", copyright = "Luaotfload Development Team", diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index 4d918b2..2f4589b 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -2,14 +2,14 @@ ------------------------------------------------------------------------------- -- FILE: luaotfload-configuration.lua -- DESCRIPTION: config file reader --- REQUIREMENTS: Luaotfload 2.7 or above +-- REQUIREMENTS: Luaotfload 2.8 or above -- AUTHOR: Philipp Gesang, -- AUTHOR: Dohyun Kim ------------------------------------------------------------------------------- -- if not modules then modules = { } end modules ["luaotfload-configuration"] = { - version = "2.7", + version = "2.8", comment = "part of Luaotfload", author = "Philipp Gesang, Dohyun Kim", copyright = "Luaotfload Development Team", diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index 66755d3..621a24b 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -1,5 +1,5 @@ if not modules then modules = { } end modules ['luaotfload-database'] = { - version = "2.7", + version = "2.8", comment = "companion to luaotfload-main.lua", author = "Khaled Hosny, Elie Roux, Philipp Gesang", copyright = "Luaotfload Development Team", diff --git a/src/luaotfload-letterspace.lua b/src/luaotfload-letterspace.lua index 5a56d31..fd64c90 100644 --- a/src/luaotfload-letterspace.lua +++ b/src/luaotfload-letterspace.lua @@ -1,5 +1,5 @@ if not modules then modules = { } end modules ['letterspace'] = { - version = "2.7", + version = "2.8", comment = "companion to luaotfload-main.lua", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL; adapted by Philipp Gesang", copyright = "PRAGMA ADE / ConTeXt Development Team", diff --git a/src/luaotfload-log.lua b/src/luaotfload-log.lua index 6a41590..ab38ffa 100644 --- a/src/luaotfload-log.lua +++ b/src/luaotfload-log.lua @@ -1,5 +1,5 @@ if not modules then modules = { } end modules ["luaotfload-log"] = { - version = "2.7", + version = "2.8", comment = "companion to Luaotfload", author = "Khaled Hosny, Elie Roux, Philipp Gesang", copyright = "Luaotfload Development Team", diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index bbe09fa..14d5316 100644 --- a/src/luaotfload-main.lua +++ b/src/luaotfload-main.lua @@ -52,8 +52,8 @@ local authors = "\z luaotfload.module = { name = "luaotfload-main", - version = 2.70003, - date = "2016/06/16", + version = 2.80001, + date = "2017/01/29", description = "OpenType layout system.", author = authors, copyright = authors, diff --git a/src/luaotfload-parsers.lua b/src/luaotfload-parsers.lua index e056460..ffb6401 100644 --- a/src/luaotfload-parsers.lua +++ b/src/luaotfload-parsers.lua @@ -2,7 +2,7 @@ ------------------------------------------------------------------------------- -- FILE: luaotfload-parsers.lua -- DESCRIPTION: various lpeg-based parsers used in Luaotfload --- REQUIREMENTS: Luaotfload >= 2.7 +-- REQUIREMENTS: Luaotfload >= 2.8 -- AUTHOR: Philipp Gesang (Phg), ------------------------------------------------------------------------------- -- diff --git a/src/luaotfload.sty b/src/luaotfload.sty index 112ec23..45744d1 100644 --- a/src/luaotfload.sty +++ b/src/luaotfload.sty @@ -1,4 +1,4 @@ -%% Copyright (C) 2009-2016 +%% Copyright (C) 2009-2017 %% %% by Elie Roux %% and Khaled Hosny @@ -41,7 +41,7 @@ \ProvidesPackage{luaotfload}% %% FIXME The date is meaningless, we need to find a way to %% use the git revision instead. - [2016/06/16 v2.7 OpenType layout system] + [2017/01/29 v2.8 OpenType layout system] \fi \directlua{ require('luaotfload-main') -- cgit v1.2.3 From 616b9077567fd670341696cb6ff2bfc71cf691a9 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Jan 2017 20:50:18 +0100 Subject: [mkglyphlist] adjust for erratic Adobe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They just had to remove the AGL download and change the format on their GH repo … Long-term we might add their repo as a submodule. --- scripts/mkglyphlist | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/scripts/mkglyphlist b/scripts/mkglyphlist index f66a686..b9d5309 100755 --- a/scripts/mkglyphlist +++ b/scripts/mkglyphlist @@ -18,7 +18,7 @@ ----------------------------------------------------------------------- local glyphfile = "./build/glyphlist.txt" local font_age = "./build/luaotfload-glyphlist.lua" -local glyph_source = "http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt" +local glyph_source = "https://raw.githubusercontent.com/adobe-type-tools/agl-aglfn/master/glyphlist.txt" ----------------------------------------------------------------------- -- fallbacks @@ -67,7 +67,7 @@ local eol = P"\n\r" + P"\r\n" + P"\r" + P"\n" local space = P" " local alphanum = R("az", "AZ", "09") local hexdigit = R("af", "AF", "09") -local eof_tag = gartenzaun * P"--end" +local eof_tag = gartenzaun * P"END" local header_line = gartenzaun * (1-eol)^0 * eol local codepoint = hexdigit^1 local glyphname = alphanum^1 @@ -140,19 +140,12 @@ local get_raw get_raw = function (retry) elseif not retry then --- attempt download print"info: retrieving glyph list from" print(glyph_source) - local glyphdata = http.request(glyph_source) - if glyphdata then - local fh = io.open(glyphfile, "wb") - if not fh then - print (string.format ("error: glyph file (%s) not writable", glyphfile)) - os.exit(-1) - end - fh:write(glyphdata) - fh:close() - return get_raw(true) + local cmd = string.format("wget '%s' -o '%s'", glyph_source, glyphfile) + local st = os.execute(string.format("wget '%s' -O '%s'", glyph_source, glyphfile)) + if st ~= 0 then + print(string.format("error: download failed; status: %d, command: %q", st, cmd)) + os.exit(-1) end - print"error: download failed" - os.exit(-1) end print("error: could not obtain glyph data from "..glyphfile) os.exit(-1) -- cgit v1.2.3