From 9151138d6d62f05ce60040c364451cd79d8c55b3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 10 May 2013 14:11:15 +0200 Subject: sync with Context as of 2013-05-10 --- luaotfload-merged.lua | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/luaotfload-merged.lua b/luaotfload-merged.lua index a0a58cc..e3f22be 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/09/13 15:23:31 +-- merge date : 05/10/13 10:26:54 do -- begin closure to overcome local limits and interference @@ -8468,29 +8468,18 @@ local function toligature(kind,lookupname,head,start,stop,char,markflag,discfoun logwarning("%s: keep mark %s, gets index %s",pref(kind,lookupname),gref(char),start[a_ligacomp]) end head,current=insert_node_after(head,current,copy_node(start)) + elseif trace_marks then + logwarning("%s: delete mark %s",pref(kind,lookupname),gref(char)) end start=start.next end - local start=components - while start and start.id==glyph_code do + local start=current.next + while start and start.id==glyph_code do local char=start.char if marks[char] then start[a_ligacomp]=baseindex+(start[a_ligacomp] or componentindex) if trace_marks then - logwarning("%s: keep mark %s, gets index %s",pref(kind,lookupname),gref(char),start[a_ligacomp]) - end - else - break - end - start=start.next - end - local start=base.next - while start and start.id==glyph_code do - local char=start.char - if marks[char] then - start[a_ligacomp]=baseindex+(start[a_ligacomp] or componentindex) - if trace_marks then - logwarning("%s: find mark %s, gets index %s",pref(kind,lookupname),gref(char),start[a_ligacomp]) + logwarning("%s: set mark %s, gets index %s",pref(kind,lookupname),gref(char),start[a_ligacomp]) end else break -- cgit v1.2.3 From 31cae80a509978639c4c19948260f36015489d69 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 10 May 2013 14:50:38 +0200 Subject: do without text figures in libertine for the time being --- luaotfload.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 0d062a6..8ee54d6 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -133,7 +133,7 @@ and the derived files \usepackage{fontspec} \usepackage{unicode-math} \setmainfont[ - Numbers = OldStyle, +% Numbers = OldStyle, %% buggy with font cache Ligatures = TeX, BoldFont = {Linux Libertine O Bold}, ItalicFont = {Linux Libertine O Italic}, -- cgit v1.2.3 From 590373869f37b8e3a6f5167b6dad502e0397b4b4 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 10 May 2013 15:30:21 +0200 Subject: set node mode more accurately --- luaotfload-features.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/luaotfload-features.lua b/luaotfload-features.lua index 8852596..220b362 100644 --- a/luaotfload-features.lua +++ b/luaotfload-features.lua @@ -337,7 +337,9 @@ local import_values = { --- That’s what the 1.x parser did, not quite as graciously, --- with an array of branch expressions. -- "style", "optsize",--> from slashed notation; handled otherwise - "lookup", "sub", "mode", + { "lookup", false }, + { "sub", false }, + { "mode", true }, } local lookup_types = { "anon", "file", "name", "path" } @@ -411,11 +413,14 @@ local handle_request = function (specification) end for n=1, #import_values do - local feat = import_values[n] + local feat = import_values[n][1] + local keep = import_values[n][2] local newvalue = request.features[feat] if newvalue then specification[feat] = request.features[feat] - --request.features[feat] = nil + if not keep then + request.features[feat] = nil + end end end -- cgit v1.2.3 From d52a91a2b882af222b67cd24b4e8a4308c32a0c6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 10 May 2013 15:57:20 +0200 Subject: [doc] avoid problem with hologo and node mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit don’t ask --- luaotfload.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 8ee54d6..849d9fd 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -407,7 +407,7 @@ and the derived files % \fileent{GFSBodoni.otf}, and % \fileent{PTZ56F.ttf}. % -% \subsection{\hologo{XeTeX} Compatibility Layer} +% \subsection{Compatibility Layer} % % In addition to the regular prefixed requests, \identifier{luaotfload} % accepts loading fonts the \XETEX way. -- cgit v1.2.3 From bc5de9881dfe0b3d1f81f13d4c5428d818a7b662 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 10 May 2013 16:26:11 +0200 Subject: remove meaningless statement --- luaotfload.dtx | 2 -- 1 file changed, 2 deletions(-) diff --git a/luaotfload.dtx b/luaotfload.dtx index 849d9fd..75d1221 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -1720,8 +1720,6 @@ local patch_defined_font = function (specification, size, id) return tfmdata end -caches.compilemethod = "both" - reset_callback("define_font") % \end{macrocode} -- cgit v1.2.3 From ce418e183f6fed281940def9b848258c8b25916e Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 10 May 2013 16:34:12 +0200 Subject: [rfc] proposal for font name fallback --- luaotfload-auxiliary.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua index c08f775..8d12d11 100644 --- a/luaotfload-auxiliary.lua +++ b/luaotfload-auxiliary.lua @@ -31,6 +31,7 @@ local stringlower = string.lower local stringformat = string.format local stringgsub = string.gsub local stringbyte = string.byte +local stringmatch = string.match ----------------------------------------------------------------------- --- font patches @@ -64,6 +65,9 @@ local add_fontdata_fallbacks = function (fontdata) else --- otf metadata = fontdata.shared.rawdata.metadata + fontdata.name = fontdata.name + or fontdata.fullname + or fontdata.psname fontdata.units = fontdata.units_per_em local resources = fontdata.resources --- the next line is a hack that fixes scaling of fonts with @@ -98,8 +102,6 @@ end --if config.luaotfload.compatibility == true then if true then - --- this will cause the output pdf to be garbled - --- in pdf.js luatexbase.add_to_callback( "luaotfload.patch_font", add_fontdata_fallbacks, -- cgit v1.2.3 From 807bccec2b3357f6c2c2dde2c7324e5fc86e0d7a Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 10 May 2013 17:34:37 +0200 Subject: remove cruft from auxlib --- luaotfload-auxiliary.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua index 8d12d11..be380e3 100644 --- a/luaotfload-auxiliary.lua +++ b/luaotfload-auxiliary.lua @@ -31,7 +31,7 @@ local stringlower = string.lower local stringformat = string.format local stringgsub = string.gsub local stringbyte = string.byte -local stringmatch = string.match +local stringfind = string.find ----------------------------------------------------------------------- --- font patches @@ -69,17 +69,13 @@ local add_fontdata_fallbacks = function (fontdata) or fontdata.fullname or fontdata.psname fontdata.units = fontdata.units_per_em + fontdata.size = fontdata.size or fontparameters.size local resources = fontdata.resources - --- the next line is a hack that fixes scaling of fonts with - --- non-standard em-sizes (most ms fonts have 2048, others - --- come with 256) - --fontdata.size = fontparameters.size * fontdata.units / 1000 --- for legacy fontspec.lua and unicode-math.lua fontdata.shared.otfdata = { pfminfo = { os2_capheight = metadata.pfminfo.os2_capheight }, metadata = { ascent = metadata.ascent }, } - --fontdata.shared.otfdata.metadata = metadata --- brr, that’s meta indeed --- for microtype and fontspec local fake_features = { } -- wrong: table.copy(resources.features) setmetatable(fake_features, { __index = function (tab, idx) -- cgit v1.2.3 From 2d352121cddf97e8249c72b58738cb2ede1b1557 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 10 May 2013 17:37:12 +0200 Subject: sync with Context as of 2013-05-10 --- luaotfload-merged.lua | 74 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 9 deletions(-) diff --git a/luaotfload-merged.lua b/luaotfload-merged.lua index e3f22be..008b02a 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 10:26:54 +-- merge date : 05/10/13 15:05:28 do -- begin closure to overcome local limits and interference @@ -5046,7 +5046,7 @@ local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf otf.glists={ "gsub","gpos" } -otf.version=2.742 +otf.version=2.743 otf.cache=containers.define("fonts","otf",otf.version,true) local fontdata=fonts.hashes.identifiers local chardata=characters and characters.data @@ -5065,6 +5065,7 @@ local usemetatables=false local packdata=true local syncspace=true local forcenotdef=false +local includesubfonts=false local wildcard="*" local default="dflt" local fontloaderfields=fontloader.fields @@ -5191,8 +5192,8 @@ local ordered_enhancers={ "check glyphs", "check metadata", "check extra features", - "add duplicates", "check encoding", + "add duplicates", "cleanup tables", } local actions=allocate() @@ -5536,7 +5537,7 @@ actions["prepare glyphs"]=function(data,filename,raw) local duplicates=resources.duplicates local variants=resources.variants if rawsubfonts then - metadata.subfonts={} + metadata.subfonts=includesubfonts and {} properties.cidinfo=rawcidinfo if rawcidinfo.registry then local cidmap=fonts.cid.getmap(rawcidinfo) @@ -5547,7 +5548,9 @@ actions["prepare glyphs"]=function(data,filename,raw) for cidindex=1,#rawsubfonts do local subfont=rawsubfonts[cidindex] local cidglyphs=subfont.glyphs - metadata.subfonts[cidindex]=somecopy(subfont) + if includesubfonts then + metadata.subfonts[cidindex]=somecopy(subfont) + end for index=0,subfont.glyphcnt-1 do local glyph=cidglyphs[index] if glyph then @@ -5556,6 +5559,10 @@ actions["prepare glyphs"]=function(data,filename,raw) if not unicode or unicode==-1 or unicode>=criterium then 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) + unicode=-1 + end if not unicode or unicode==-1 or unicode>=criterium then if not name then name=format("u%06X",private) @@ -5659,7 +5666,8 @@ actions["check encoding"]=function(data,filename,raw) local resources=data.resources local properties=data.properties local unicodes=resources.unicodes - local indices=resources.indices + local indices=resources.indices + local duplicates=resources.duplicates local mapdata=raw.map or {} local unicodetoindex=mapdata and mapdata.map or {} local encname=lower(data.enc_name or mapdata.enc_name or "") @@ -5671,10 +5679,35 @@ actions["check encoding"]=function(data,filename,raw) for unicode,index in next,unicodetoindex do if unicode<=criterium and not descriptions[unicode] then local parent=indices[index] - if parent then - report_otf("weird, unicode %U points to %U with index %H",unicode,parent,index) - else + if not parent then report_otf("weird, unicode %U points to nowhere with index %H",unicode,index) + else + local parentdescription=descriptions[parent] + if parentdescription then + local altuni=parentdescription.altuni + if not altuni then + altuni={ { unicode=parent } } + parentdescription.altuni=altuni + duplicates[parent]={ unicode } + else + local done=false + for i=1,#altuni do + if altuni[i].unicode==parent then + done=true + break + end + end + if not done then + altuni[#altuni+1]={ unicode=parent } + table.insert(duplicates[parent],unicode) + end + end + if trace_loading then + report_otf("weird, unicode %U points to nowhere with index %H",unicode,index) + end + else + report_otf("weird, unicode %U points to %U with index %H",unicode,index) + end end end end @@ -10691,6 +10724,12 @@ local function packdata(data) end end end + local altuni=description.altuni + if altuni then + for i=1,#altuni do + altuni[i]=pack_flat(altuni[i]) + end + end end local lookups=data.lookups if lookups then @@ -10795,6 +10834,10 @@ local function packdata(data) mlookups[tag]=pack_normal(mlookup) end end + local altuni=description.altuni + if altuni then + description.altuni=pack_normal(altuni) + end end local lookups=data.lookups if lookups then @@ -10986,6 +11029,19 @@ local function unpackdata(data) end end end + local altuni=description.altuni + if altuni then + local altuni=tables[altuni] + if altuni then + description.altuni=altuni + for i=1,#altuni do + local tv=tables[altuni[i]] + if tv then + altuni[i]=tv + end + end + end + end end local lookups=data.lookups if lookups then -- cgit v1.2.3