summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-osd.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-08-04 09:53:17 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-08-04 09:53:17 +0200
commit817e18d3f6969b1b50b4883ec4d5bb05c985db88 (patch)
tree3569da776df0f8bcf449efd99b11380544d44ec5 /tex/context/base/mkiv/font-osd.lua
parentab253433729006addd4336870face2facce5f894 (diff)
downloadcontext-817e18d3f6969b1b50b4883ec4d5bb05c985db88.tar.gz
2017-08-04 09:46:00
Diffstat (limited to 'tex/context/base/mkiv/font-osd.lua')
-rw-r--r--tex/context/base/mkiv/font-osd.lua74
1 files changed, 18 insertions, 56 deletions
diff --git a/tex/context/base/mkiv/font-osd.lua b/tex/context/base/mkiv/font-osd.lua
index 9adc8bff2..04fbf88f5 100644
--- a/tex/context/base/mkiv/font-osd.lua
+++ b/tex/context/base/mkiv/font-osd.lua
@@ -461,7 +461,6 @@ local sequence_reorder_matras = {
nofsteps = 1,
steps = {
{
- osdstep = true,
coverage = pre_mark,
}
}
@@ -476,7 +475,6 @@ local sequence_reorder_reph = {
nofsteps = 1,
steps = {
{
- osdstep = true,
coverage = { },
}
}
@@ -491,7 +489,6 @@ local sequence_reorder_pre_base_reordering_consonants = {
nofsteps = 1,
steps = {
{
- osdstep = true,
coverage = { },
}
}
@@ -505,7 +502,7 @@ local sequence_remove_joiners = {
type = "devanagari_remove_joiners",
nofsteps = 1,
steps = {
- { osdstep = true,
+ {
coverage = both_joiners_true,
},
}
@@ -633,35 +630,22 @@ local function initializedevanagi(tfmdata)
if coverage then
local reph = false
if kind == "rphf" then
- --
- -- KE: I don't understand the rationale behind osdstep. The original if
- -- statement checked whether coverage is contextual chaining.
- --
- -- HH: The osdstep signals that we deal with our own feature here, not
- -- one in the font itself so it was just a safeguard against us overloading
- -- something driven by the font.
- --
- -- if step.osdstep then -- selective
- if true then -- always
- -- rphf acts on consonant + halant
- for k, v in next, ra do
- local r = coverage[k]
- if r then
- local h = false
- for k, v in next, halant do
- local h = r[k]
- if h then
- reph = h.ligature or false
- break
- end
- end
- if reph then
+ -- rphf acts on consonant + halant
+ for k, v in next, ra do
+ local r = coverage[k]
+ if r then
+ local h = false
+ for k, v in next, halant do
+ local h = r[k]
+ if h then
+ reph = h.ligature or false
break
end
end
+ if reph then
+ break
+ end
end
- else
- -- rphf might be result of other handler/chainproc
end
end
seqsubset[#seqsubset+1] = { kind, coverage, reph }
@@ -1289,7 +1273,11 @@ end
-- 2 Try to find a target position the same way as for pre-base matra. If it is found, reorder pre-base consonant glyph.
-- 3 If position is not found, reorder immediately before main consonant.
--- UNTESTED: NOT CALLED IN EXAMPLE
+-- Here we implement a few handlers:
+--
+-- function(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step)
+-- return head, start, done
+-- end
function handlers.devanagari_reorder_pre_base_reordering_consonants(head,start)
local current = start
@@ -1349,32 +1337,6 @@ function handlers.devanagari_reorder_pre_base_reordering_consonants(head,start)
return head, start, true
end
--- function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replacement)
--- local stop = getnext(start)
--- local font = getfont(start)
--- while stop do
--- local char = ischar(stop)
--- if char and (char == c_zwnj or char == c_zwj) then
--- stop = getnext(stop)
--- else
--- break
--- end
--- end
--- if stop then
--- setnext(getprev(stop))
--- setprev(stop,getprev(start))
--- end
--- local prev = getprev(start)
--- if prev then
--- setnext(prev,stop)
--- end
--- if head == start then
--- head = stop
--- end
--- flush_list(start)
--- return head, stop, true
--- end
-
function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replacement)
local stop = getnext(start)
local font = getfont(start)