From 195d57dba1533a03204aa8b7ff26ed2bb28d3405 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 9 May 2016 07:15:44 +0200 Subject: [fontloader] sync with Context as of 2016-05-09 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #349 and #357. Also the new AFM code is due, let’s see what else we need to use it. --- src/fontloader/misc/fontloader-font-ots.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/fontloader/misc/fontloader-font-ots.lua') diff --git a/src/fontloader/misc/fontloader-font-ots.lua b/src/fontloader/misc/fontloader-font-ots.lua index 21225c2..c173de2 100644 --- a/src/fontloader/misc/fontloader-font-ots.lua +++ b/src/fontloader/misc/fontloader-font-ots.lua @@ -3652,6 +3652,9 @@ registerotffeature { } } +otf.nodemodeinitializer = featuresinitializer +otf.featuresprocessor = featuresprocessor + -- This can be used for extra handlers, but should be used with care! otf.handlers = handlers -- used in devanagari -- cgit v1.2.3 From 274ca61bf7ea43543c5aea53873f22c8b598b4a9 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 20 May 2016 08:06:55 +0200 Subject: [fontloader] sync with Context as of 2016-05-22 --- src/fontloader/misc/fontloader-font-ots.lua | 35 +++++++++++++---------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'src/fontloader/misc/fontloader-font-ots.lua') diff --git a/src/fontloader/misc/fontloader-font-ots.lua b/src/fontloader/misc/fontloader-font-ots.lua index c173de2..669668e 100644 --- a/src/fontloader/misc/fontloader-font-ots.lua +++ b/src/fontloader/misc/fontloader-font-ots.lua @@ -145,10 +145,8 @@ local report_direct = logs.reporter("fonts","otf direct") local report_subchain = logs.reporter("fonts","otf subchain") local report_chain = logs.reporter("fonts","otf chain") local report_process = logs.reporter("fonts","otf process") ------ report_prepare = logs.reporter("fonts","otf prepare") local report_warning = logs.reporter("fonts","otf warning") local report_run = logs.reporter("fonts","otf run") -local report_check = logs.reporter("fonts","otf check") registertracker("otf.replacements", "otf.singles,otf.multiples,otf.alternatives,otf.ligatures") registertracker("otf.positions","otf.marks,otf.kerns,otf.cursive") @@ -185,10 +183,7 @@ local setlink = nuts.setlink local ischar = nuts.is_char -local insert_node_before = nuts.insert_before local insert_node_after = nuts.insert_after -local delete_node = nuts.delete -local remove_node = nuts.remove local copy_node = nuts.copy local copy_node_list = nuts.copy_list local find_node_tail = nuts.tail @@ -3064,7 +3059,7 @@ local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlm while start do local char = ischar(start,font) if char then - local a = getattr(start,0) + local a = attr and getattr(start,0) if not a or (a == attr) then local lookupmatch = lookupcache[char] if lookupmatch then @@ -3097,7 +3092,7 @@ local function t_run_single(start,stop,font,attr,lookupcache) while start ~= stop do local char = ischar(start,font) if char then - local a = getattr(start,0) + local a = attr and getattr(start,0) if not a or (a == attr) then local lookupmatch = lookupcache[char] if lookupmatch then -- hm, hyphens can match (tlig) so we need to really check @@ -3132,7 +3127,7 @@ local function t_run_single(start,stop,font,attr,lookupcache) end -- local function d_run_single(prev,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) --- local a = getattr(prev,0) +-- local a = attr and getattr(prev,0) -- if not a or (a == attr) then -- local char = ischar(prev) -- can be disc -- if char then @@ -3149,7 +3144,7 @@ end -- end local function k_run_single(sub,injection,last,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) - local a = getattr(sub,0) + local a = attr and getattr(sub,0) if not a or (a == attr) then for n in traverse_nodes(sub) do -- only gpos if n == last then @@ -3181,7 +3176,7 @@ local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlm while start do local char = ischar(start,font) if char then - local a = getattr(start,0) + local a = attr and getattr(start,0) if not a or (a == attr) then for i=1,nofsteps do local step = steps[i] @@ -3228,7 +3223,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps) while start ~= stop do local char = ischar(start,font) if char then - local a = getattr(start,0) + local a = attr and getattr(start,0) if not a or (a == attr) then for i=1,nofsteps do local step = steps[i] @@ -3271,7 +3266,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps) end -- local function d_run_multiple(prev,attr,steps,nofsteps,dataset,sequence,rlmode,handler) --- local a = getattr(prev,0) +-- local a = attr and getattr(prev,0) -- if not a or (a == attr) then -- local char = ischar(prev) -- can be disc -- if char then @@ -3297,7 +3292,7 @@ end -- end local function k_run_multiple(sub,injection,last,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler) - local a = getattr(sub,0) + local a = attr and getattr(sub,0) if not a or (a == attr) then for n in traverse_nodes(sub) do -- only gpos if n == last then @@ -3394,6 +3389,10 @@ local function featuresprocessor(head,font,attr) end + if attr == 0 then + attr = false -- some 10% faster when no dynamics but hardly measureable on real runs + end + head = tonut(head) if trace_steps then @@ -3405,7 +3404,7 @@ local function featuresprocessor(head,font,attr) local done = false local datasets = otf.dataset(tfmdata,font,attr) - local dirstack = { } -- could move outside function btu we can have local runss + local dirstack = { } -- could move outside function but we can have local runs sweephead = { } @@ -3451,7 +3450,7 @@ local function featuresprocessor(head,font,attr) while start do local char = ischar(start,font) if char then - local a = getattr(start,0) + local a = attr and getattr(start,0) if not a or (a == attr) then for i=1,nofsteps do local step = steps[i] @@ -3489,14 +3488,12 @@ local function featuresprocessor(head,font,attr) local step = steps[1] local lookupcache = step.coverage if not lookupcache then - -- can't happen, no check in loop either report_missing_coverage(dataset,sequence) else - while start do local char, id = ischar(start,font) if char then - local a = getattr(start,0) + local a = attr and getattr(start,0) if a then a = (a == attr) and (not attribute or getprop(start,a_state) == attribute) else @@ -3553,7 +3550,7 @@ local function featuresprocessor(head,font,attr) while start do local char, id = ischar(start,font) if char then - local a = getattr(start,0) + local a = attr and getattr(start,0) if a then a = (a == attr) and (not attribute or getprop(start,a_state) == attribute) else -- cgit v1.2.3 From d8ba9c36eaf49c1f28b8e8f11c969b77ece32db4 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 12 Jun 2016 18:14:33 +0200 Subject: [fontloader] sync with Context as of 2016-06-12 --- src/fontloader/misc/fontloader-font-ots.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/fontloader/misc/fontloader-font-ots.lua') diff --git a/src/fontloader/misc/fontloader-font-ots.lua b/src/fontloader/misc/fontloader-font-ots.lua index 669668e..51704bf 100644 --- a/src/fontloader/misc/fontloader-font-ots.lua +++ b/src/fontloader/misc/fontloader-font-ots.lua @@ -124,7 +124,7 @@ local trace_cursive = false registertracker("otf.cursive", function(v local trace_preparing = false registertracker("otf.preparing", function(v) trace_preparing = v end) local trace_bugs = false registertracker("otf.bugs", function(v) trace_bugs = v end) local trace_details = false registertracker("otf.details", function(v) trace_details = v end) -local trace_applied = false registertracker("otf.applied", function(v) trace_applied = v end) +----- trace_applied = false registertracker("otf.applied", function(v) trace_applied = v end) local trace_steps = false registertracker("otf.steps", function(v) trace_steps = v end) local trace_skips = false registertracker("otf.skips", function(v) trace_skips = v end) local trace_directions = false registertracker("otf.directions", function(v) trace_directions = v end) @@ -239,7 +239,7 @@ local cursonce = true local fonthashes = fonts.hashes local fontdata = fonthashes.identifiers -local otffeatures = fonts.constructors.newfeatures("otf") +local otffeatures = fonts.constructors.features.otf local registerotffeature = otffeatures.register local onetimemessage = fonts.loggers.onetimemessage or function() end @@ -3389,9 +3389,13 @@ local function featuresprocessor(head,font,attr) end - if attr == 0 then - attr = false -- some 10% faster when no dynamics but hardly measureable on real runs - end + -- some 10% faster when no dynamics but hardly measureable on real runs .. but: it only + -- works when we have no other dynamics as otherwise the zero run will be applied to the + -- whole stream for which we then need to pass another variable which we won't + + -- if attr == 0 then + -- attr = false + -- end head = tonut(head) @@ -3484,7 +3488,6 @@ local function featuresprocessor(head,font,attr) local start = head -- local ? rlmode = 0 -- to be checked ? if nofsteps == 1 then -- happens often - local step = steps[1] local lookupcache = step.coverage if not lookupcache then -- cgit v1.2.3