diff options
Diffstat (limited to 'tex/context/base/mkiv/typo-krn.lua')
-rw-r--r-- | tex/context/base/mkiv/typo-krn.lua | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/tex/context/base/mkiv/typo-krn.lua b/tex/context/base/mkiv/typo-krn.lua index 24a91d6b6..71d9736a4 100644 --- a/tex/context/base/mkiv/typo-krn.lua +++ b/tex/context/base/mkiv/typo-krn.lua @@ -8,6 +8,8 @@ if not modules then modules = { } end modules ['typo-krn'] = { -- glue is still somewhat suboptimal -- components: better split on tounicode +-- +-- maybe ignore when properties[n].injections.cursivex (or mark) local next, type, tonumber = next, type, tonumber @@ -31,7 +33,6 @@ local insert_node_after = nuts.insert_after local end_of_math = nuts.end_of_math local use_components = nuts.use_components -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid @@ -79,7 +80,7 @@ local user_list_code = listcodes.unknown local discretionary_code = disccodes.discretionary local automatic_code = disccodes.automatic -local kerning_code = kerncodes.kerning +local fontkern_code = kerncodes.fontkern local userkern_code = kerncodes.userkern local userskip_code = skipcodes.userskip local spaceskip_code = skipcodes.spaceskip @@ -103,8 +104,8 @@ local v_auto = interfaces.variables.auto typesetters = typesetters or { } local typesetters = typesetters -typesetters.kerns = typesetters.kerns or { } -local kerns = typesetters.kerns +local kerns = typesetters.kerns or { } +typesetters.kerns = kerns local report = logs.reporter("kerns") local trace_ligatures = false trackers.register("typesetters.kerns.ligatures", function(v) trace_ligatures = v end) @@ -113,7 +114,6 @@ local trace_ligatures_d = false trackers.register("typesetters.kerns.ligatures kerns.mapping = kerns.mapping or { } kerns.factors = kerns.factors or { } local a_kerns = attributes.private("kern") -local a_fontkern = attributes.private('fontkern') local contextsetups = fonts.specifiers.contextsetups @@ -223,7 +223,7 @@ end local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyph local char, id = isglyph(boundary) if id == kern_code then - if getsubtype(boundary) == kerning_code or getattr(boundary,a_fontkern) then + if getsubtype(boundary) == fontkern_code then local inject = true if keeptogether then local next = getnext(boundary) @@ -259,7 +259,7 @@ local function inject_end(boundary,next,keeptogether,krn,ok) local tail = find_node_tail(boundary) local char, id = getid(tail) if id == kern_code then - if getsubtype(tail) == kerning_code or getattr(tail,a_fontkern) then + if getsubtype(tail) == fontkern_code then local inject = true if keeptogether then local prev = getprev(tail) @@ -309,7 +309,7 @@ local function process_list(head,keeptogether,krn,font,okay) if mark[char] then -- skip elseif pid == kern_code then - if getsubtype(prev) == kerning_code or getattr(prev,a_fontkern) then + if getsubtype(prev) == fontkern_code then local inject = true if keeptogether then local prevprev = getprev(prev) @@ -408,7 +408,7 @@ function kerns.handler(head) elseif mark[char] then -- skip elseif previd == kern_code then - if getsubtype(prev) == kerning_code or getattr(prev,a_fontkern) then + if getsubtype(prev) == fontkern_code then local inject = true if keeptogether then if previd == glyph_code and keeptogether(prev,start) then @@ -446,24 +446,24 @@ function kerns.handler(head) elseif id == disc_code then local prev, next, pglyph, nglyph -- delayed till needed local subtype = getsubtype(start) - if subtype == automatic_code then - -- this is kind of special, as we have already injected the - -- previous kern - local prev = getprev(start) - local pglyph = prev and getid(prev) == glyph_code - languages.expand(start,pglyph and prev) - -- we can have a different start now - elseif subtype ~= discretionary_code then - prev = getprev(start) - pglyph = prev and getid(prev) == glyph_code - languages.expand(start,pglyph and prev) - end + -- if subtype == automatic_code then + -- -- this is kind of special, as we have already injected the + -- -- previous kern + -- local prev = getprev(start) + -- local pglyph = prev and getid(prev) == glyph_code + -- languages.expand(start,pglyph and prev) + -- -- we can have a different start now + -- elseif subtype ~= discretionary_code then + -- prev = getprev(start) + -- pglyph = prev and getid(prev) == glyph_code + -- languages.expand(start,pglyph and prev) + -- end local pre, post, replace = getdisc(start) local indeed = false if pre then local okay = false if not prev then - prev = prev or getprev(start) + prev = getprev(start) pglyph = prev and getid(prev) == glyph_code end if pglyph then @@ -491,7 +491,7 @@ function kerns.handler(head) if replace then local okay = false if not prev then - prev = prev or getprev(start) + prev = getprev(start) pglyph = prev and getid(prev) == glyph_code end if pglyph then @@ -518,7 +518,7 @@ function kerns.handler(head) end bound = false elseif id == kern_code then - bound = getsubtype(start) == kerning_code or getattr(start,a_fontkern) + bound = getsubtype(start) == fontkern_code prev = start previd = id elseif id == glue_code then @@ -564,7 +564,7 @@ function kerns.handler(head) start = getnext(start) end elseif id == kern_code then - bound = getsubtype(start) == kerning_code or getattr(start,a_fontkern) + bound = getsubtype(start) == fontkern_code prev = start previd = id start = getnext(start) |