From 55663ee9f171539dd39a87b12200654edd3bfded Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 18 Jul 2014 19:54:46 +0200 Subject: [fontloader] sync with Context as of 2014-07-18 --- src/luaotfload-fontloader.lua | 54 ++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/luaotfload-fontloader.lua b/src/luaotfload-fontloader.lua index 09582f9..293a319 100644 --- a/src/luaotfload-fontloader.lua +++ b/src/luaotfload-fontloader.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 07/14/14 19:25:59 +-- merge date : 07/18/14 14:12:32 do -- begin closure to overcome local limits and interference @@ -1603,14 +1603,25 @@ local function identical(a,b) end table.identical=identical table.are_equal=are_equal -function table.compact(t) - if t then - for k,v in next,t do - if not next(v) then - t[k]=nil +local function sparse(old,nest,keeptables) + local new={} + for k,v in next,old do + if not (v=="" or v==false) then + if nest and type(v)=="table" then + v=sparse(v,nest) + if keeptables or next(v) then + new[k]=v + end + else + new[k]=v end end end + return new +end +table.sparse=sparse +function table.compact(t) + return sparse(t,true,true) end function table.contains(t,v) if t then @@ -6681,7 +6692,7 @@ local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf otf.glists={ "gsub","gpos" } -otf.version=2.758 +otf.version=2.759 otf.cache=containers.define("fonts","otf",otf.version,true) local fontdata=fonts.hashes.identifiers local chardata=characters and characters.data @@ -7236,7 +7247,9 @@ end unicode=cidunicodes[index] end if unicode and descriptions[unicode] then - report_otf("preventing glyph %a at index %H to overload unicode %U",name or "noname",index,unicode) + if trace_private then + report_otf("preventing glyph %a at index %H to overload unicode %U",name or "noname",index,unicode) + end unicode=-1 end if not unicode or unicode==-1 then @@ -7889,12 +7902,12 @@ actions["reorganize lookups"]=function(data,filename,raw) local fore=glyphs.fore if fore and fore~="" then fore=s_uncover(splitter,s_u_cache,fore) - rule.before=s_hashed(fore,s_h_cache) + rule.after=s_hashed(fore,s_h_cache) end local back=glyphs.back if back then back=s_uncover(splitter,s_u_cache,back) - rule.after=s_hashed(back,s_h_cache) + rule.before=s_hashed(back,s_h_cache) end local names=glyphs.names if names then @@ -13052,27 +13065,6 @@ local function unpackdata(data) rule.replacements=tv end end - local fore=rule.fore - if fore then - local tv=tables[fore] - if tv then - rule.fore=tv - end - end - local back=rule.back - if back then - local tv=tables[back] - if tv then - rule.back=tv - end - end - local names=rule.names - if names then - local tv=tables[names] - if tv then - rule.names=tv - end - end local lookups=rule.lookups if lookups then local tv=tables[lookups] -- cgit v1.2.3 From f2bb496d4df55c80bda955b4b2fdc0cabd332b4f Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 18 Jul 2014 23:48:24 +0200 Subject: [parsers] fix missing argument to fontconfig scanner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reference to ``find_files`` didn’t get passed on to recursive calls which caused an error if multiple directories are searched. Reported by Norbert Preining. --- src/luaotfload-parsers.lua | 62 +++++++++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/luaotfload-parsers.lua b/src/luaotfload-parsers.lua index 3eeb614..e7f9cd2 100644 --- a/src/luaotfload-parsers.lua +++ b/src/luaotfload-parsers.lua @@ -217,20 +217,35 @@ local conf_filter = function (path) end --[[doc-- - read_fonts_conf_indeed() is called with seven arguments; the - latter three are tables that represent the state and are - always returned. + + read_fonts_conf_indeed() -- Scan paths included from fontconfig + configuration files recursively. Called with eight arguments. The first four are + · the path to the file · the expanded $HOME · the expanded $XDG_CONFIG_HOME · the expanded $XDG_DATA_HOME + + determining the path to be checked. Another three arguments are + tables that represent the state of the current job as lists of + strings; these are always returned. Finally a reference to the + find_files function is passed. + --doc]]-- ---- string -> string -> string -> tab -> tab -> (tab * tab * tab) + +--- string -> string -> string -> string +--- -> string list -> string list -> string list +--- -> (string -> fun option -> string list) +--- -> tab * tab * tab local read_fonts_conf_indeed -read_fonts_conf_indeed = function (start, home, xdg_config_home, +read_fonts_conf_indeed = function (start, + home, + xdg_config_home, xdg_data_home, - acc, done, dirs_done, + acc, + done, + dirs_done, find_files) local paths = fonts_conf_scanner(start) @@ -281,16 +296,26 @@ read_fonts_conf_indeed = function (start, home, xdg_config_home, then --- we exclude path with texmf in them, as they should --- be found otherwise - acc = read_fonts_conf_indeed( - path, home, xdg_config_home, xdg_data_home, - acc, done, dirs_done) + acc = read_fonts_conf_indeed(path, + home, + xdg_config_home, + xdg_data_home, + acc, + done, + dirs_done, + find_files) elseif lfsisdir(path) then --- arrow code ahead local config_files = find_files (path, conf_filter) for _, filename in next, config_files do if not done[filename] then - acc = read_fonts_conf_indeed( - filename, home, xdg_config_home, xdg_data_home, - acc, done, dirs_done) + acc = read_fonts_conf_indeed(filename, + home, + xdg_config_home, + xdg_data_home, + acc, + done, + dirs_done, + find_files) end end end --- match “kind” @@ -325,11 +350,14 @@ local read_fonts_conf = function (path_list, find_files) local done = { } ---> set: files inspected local dirs_done = { } ---> set: dirs in list for i=1, #path_list do --- we keep the state between files - acc, done, dirs_done = read_fonts_conf_indeed( - path_list[i], home, xdg_config_home, - xdg_data_home, - acc, done, dirs_done, - find_files) + acc, done, dirs_done = read_fonts_conf_indeed(path_list[i], + home, + xdg_config_home, + xdg_data_home, + acc, + done, + dirs_done, + find_files) end return acc end -- cgit v1.2.3 From 120b557526db2a73cd3eab41c9eddf142778b684 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 18 Jul 2014 23:53:56 +0200 Subject: [parsers] fix damage to indentation caused by refactoring --- src/luaotfload-parsers.lua | 62 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/luaotfload-parsers.lua b/src/luaotfload-parsers.lua index e7f9cd2..0461e24 100644 --- a/src/luaotfload-parsers.lua +++ b/src/luaotfload-parsers.lua @@ -282,21 +282,33 @@ read_fonts_conf_indeed = function (start, path = filejoin(xdg_config_home, path) end --- here the path can be four things: a directory or a file, - --- in absolute or relative path. + --- an absolute or relative path. if stringsub(path, 1, 1) == "~" then path = filejoin(home, stringsub(path, 2)) elseif --- if the path is relative, we make it absolute not ( lfsisfile(path) or lfsisdir(path) ) - then + then path = filejoin(filedirname(start), path) - end - if lfsisfile(path) - and kpsereadable_file(path) - and not done[path] - then - --- we exclude path with texmf in them, as they should - --- be found otherwise - acc = read_fonts_conf_indeed(path, + end + if lfsisfile(path) + and kpsereadable_file(path) + and not done[path] + then + --- we exclude path with texmf in them, as they should + --- be found otherwise + acc = read_fonts_conf_indeed(path, + home, + xdg_config_home, + xdg_data_home, + acc, + done, + dirs_done, + find_files) + elseif lfsisdir(path) then --- arrow code ahead + local config_files = find_files (path, conf_filter) + for _, filename in next, config_files do + if not done[filename] then + acc = read_fonts_conf_indeed(filename, home, xdg_config_home, xdg_data_home, @@ -304,28 +316,16 @@ read_fonts_conf_indeed = function (start, done, dirs_done, find_files) - elseif lfsisdir(path) then --- arrow code ahead - local config_files = find_files (path, conf_filter) - for _, filename in next, config_files do - if not done[filename] then - acc = read_fonts_conf_indeed(filename, - home, - xdg_config_home, - xdg_data_home, - acc, - done, - dirs_done, - find_files) - end - end - end --- match “kind” - end --- iterate paths - end + end + end + end --- match “kind” + end --- iterate paths + end - --inspect(acc) - --inspect(done) - return acc, done, dirs_done - end --- read_fonts_conf_indeed() + --inspect(acc) + --inspect(done) + return acc, done, dirs_done +end --- read_fonts_conf_indeed() --[[doc-- read_fonts_conf() sets up an accumulator and two sets -- cgit v1.2.3