From 1f05308a7f1730ffe1bb51872f5c7aef0a65b3eb Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 12 May 2013 22:09:30 +0200 Subject: sync with Context as of 2013-05-12 --- luaotfload-merged.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luaotfload-merged.lua b/luaotfload-merged.lua index 008b02a..0cc61b4 100644 --- a/luaotfload-merged.lua +++ b/luaotfload-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/10/13 15:05:28 +-- merge date : 05/12/13 14:50:50 do -- begin closure to overcome local limits and interference @@ -4650,7 +4650,7 @@ local function fromunicode16(str) return tonumber(str,16) else local l,r=match(str,"(....)(....)") - return (tonumber(l,16)- 0xD800)*0x400+tonumber(r,16)-0xDC00 + return (tonumber(l,16))*0x400+tonumber(r,16)-0xDC00 end end mappings.loadlumtable=loadlumtable -- cgit v1.2.3 From 050a2633ba5f599830f725f4d186b9eb13e9e807 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 12 May 2013 22:57:57 +0200 Subject: move scan_external_dir() to auxlib --- luaotfload-auxiliary.lua | 28 ++++++++++++++++++++++++++++ luaotfload-database.lua | 19 +------------------ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua index 999bc22..11af445 100644 --- a/luaotfload-auxiliary.lua +++ b/luaotfload-auxiliary.lua @@ -32,6 +32,7 @@ local stringformat = string.format local stringgsub = string.gsub local stringbyte = string.byte local stringfind = string.find +local tablecopy = table.copy ----------------------------------------------------------------------- --- font patches @@ -467,4 +468,31 @@ end aux.sprint_math_dimension = sprint_math_dimension +----------------------------------------------------------------------- +--- extra database functions +----------------------------------------------------------------------- + +--- migrated from luaotfload-database.lua +--- https://github.com/lualatex/luaotfload/pull/61#issuecomment-17776975 + +--- string -> (int, int) +local scan_external_dir = function (dir) + local old_names, new_names = names.data + if not old_names then + old_names = load_names() + end + new_names = tablecopy(old_names) + local n_scanned, n_new = fonts.names.scan_dir(dir, old_names, + new_names) + --- FIXME + --- This doesn’t seem right. If a db update is triggered after this + --- point, then the added fonts will be saved along with it -- + --- which is not as “temporarily” as it should be. (This should be + --- addressed during a refactoring of names_resolve().) + names.data = new_names + return n_scanned, n_new +end + +aux.scan_external_dir = scan_external_dir + -- vim:tw=71:sw=2:ts=2:expandtab diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 60a7977..f4c6fdc 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -249,7 +249,6 @@ local resolve local resolve_cached local save_names local save_lookups -local scan_external_dir local update_names --- state of the database @@ -1652,31 +1651,15 @@ local show_cache = function ( ) return true end ---- is this used anywhere? we decided to comment it for the ---- time being. ---- https://github.com/lualatex/luaotfload/pull/61 ---scan_external_dir = function (dir) --- local old_names, new_names --- if fonts_loaded then --- old_names = names.data --- else --- old_names = load_names() --- end --- new_names = tablecopy(old_names) --- local n_scanned, n_new = scan_dir(dir, old_names, new_names) --- names.data = new_names --- return n_scanned, n_new ---end - ----------------------------------------------------------------------- --- export functionality to the namespace “fonts.names” ----------------------------------------------------------------------- +names.scan_dir = scan_dir names.flush_lookup_cache = flush_lookup_cache names.save_lookups = save_lookups names.load = load_names names.save = save_names ------.scan = scan_external_dir names.update = update_names names.crude_file_lookup = crude_file_lookup names.crude_file_lookup_verbose = crude_file_lookup_verbose -- cgit v1.2.3 From 390464dc65a3be849cf9588497fff25678cf38e3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 12 May 2013 23:38:48 +0200 Subject: sync with Context as of 2013-05-12 (II) --- luaotfload-merged.lua | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/luaotfload-merged.lua b/luaotfload-merged.lua index 0cc61b4..f814bdb 100644 --- a/luaotfload-merged.lua +++ b/luaotfload-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/12/13 14:50:50 +-- merge date : 05/12/13 22:16:22 do -- begin closure to overcome local limits and interference @@ -2896,8 +2896,13 @@ if context then texio.write_nl("fatal error: this module is not for context") os.exit() end -local dummyfunction=function() end -local dummyreporter=function(c) return function(...) texio.write_nl(c.." : "..string.formatters(...)) end end +local dummyfunction=function() +end +local dummyreporter=function(c) + return function(...) + (texio.reporter or texio.write_nl)(c.." : "..string.formatters(...)) + end +end statistics={ register=dummyfunction, starttiming=dummyfunction, @@ -8336,7 +8341,7 @@ local fonthashes=fonts.hashes local fontdata=fonthashes.identifiers local otffeatures=fonts.constructors.newfeatures("otf") local registerotffeature=otffeatures.register -local onetimemessage=fonts.loggers.onetimemessage +local onetimemessage=fonts.loggers.onetimemessage or function() end otf.defaultnodealternate="none" local tfmdata=false local characters=false @@ -8733,7 +8738,7 @@ function handlers.gpos_mark2base(head,start,kind,lookupname,markanchors,sequence logwarning("%s, no matching anchors for mark %s and base %s",pref(kind,lookupname),gref(markchar),gref(basechar)) end end - else + elseif trace_bugs then onetimemessage(currentfont,basechar,"no base anchors",report_fonts) end elseif trace_bugs then @@ -8799,7 +8804,7 @@ function handlers.gpos_mark2ligature(head,start,kind,lookupname,markanchors,sequ end end end - else + elseif trace_bugs then onetimemessage(currentfont,basechar,"no base anchors",report_fonts) end elseif trace_bugs then @@ -8852,7 +8857,7 @@ function handlers.gpos_mark2mark(head,start,kind,lookupname,markanchors,sequence end end end - else + elseif trace_bugs then onetimemessage(currentfont,basechar,"no base anchors",report_fonts) end elseif trace_bugs then @@ -8901,7 +8906,7 @@ function handlers.gpos_cursive(head,start,kind,lookupname,exitanchors,sequence) end end end - else + elseif trace_bugs then onetimemessage(currentfont,startchar,"no entry anchors",report_fonts) end break @@ -9449,7 +9454,7 @@ function chainprocs.gpos_cursive(head,start,stop,kind,chainname,currentcontext,l end end end - else + elseif trace_bugs then onetimemessage(currentfont,startchar,"no entry anchors",report_fonts) end break -- cgit v1.2.3