diff options
Diffstat (limited to 'tex/context/base/mkxl/lpdf-rul.lmt')
-rw-r--r-- | tex/context/base/mkxl/lpdf-rul.lmt | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/tex/context/base/mkxl/lpdf-rul.lmt b/tex/context/base/mkxl/lpdf-rul.lmt index 2c8227be9..bfedf23b2 100644 --- a/tex/context/base/mkxl/lpdf-rul.lmt +++ b/tex/context/base/mkxl/lpdf-rul.lmt @@ -355,6 +355,7 @@ do local f_rectangle = formatters["%.6N w %.6N %.6N %.6N %.6N re %s"] local f_baselined = formatters["%.6N w %.6N %.6N %.6N %.6N re s %.6N %.6N m %.6N %.6N l s"] local f_dashlined = formatters["%.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s"] + local f_dashtwice = formatters["%.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s %.6N %.6N m %.6N %.6N l s"] local f_radtangle = formatters[ [[%.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y @@ -396,34 +397,18 @@ h %s]] local h = h * bpfactor local d = d * bpfactor local o = l / 2 - if (d >= 0 and h >= 0) or (d <= 0 and h <= 0) then - local dashed = tonumber(p.dashed) - if dashed and dashed > 5*line then - dashed = dashed * bpfactor - local delta = (w - 2*dashed*floor(w/(2*dashed)))/2 - pdfprint("direct",f_dashlined(l,o,o,w-l,h+d-l,dashed,dashed,delta,d,w-delta,d)) - else - pdfprint("direct",f_baselined(l,o,o,w-l,h+d-l,0,d,w,d)) - end - else - pdfprint("direct",f_rectangle(l,o,o,w-l,h+d-l,"s")) - end - end - - local function rule_box(p,h,v,i,n) - local w, h, d = getwhd(n) - local line = p.line or 65536 - local l = line *bpfactor - local w = w * bpfactor - local h = h * bpfactor - local d = d * bpfactor - local o = l / 2 + local u = p.double if p.baseline ~= false and ((d >= 0 and h >= 0) or (d <= 0 and h <= 0)) then local dashed = tonumber(p.dashed) if dashed and dashed > 5*line then dashed = dashed * bpfactor local delta = (w - 2*dashed*floor(w/(2*dashed)))/2 - pdfprint("direct",f_dashlined(l,o,o,w-l,h+d-l,dashed,dashed,delta,d,w-delta,d)) + if u then + u = u * bpfactor + pdfprint("direct",f_dashtwice(l,o,o,w-l,h+d-l,dashed,dashed,delta,d,w-delta,d,delta,d+u,w-delta,d+u)) + else + pdfprint("direct",f_dashlined(l,o,o,w-l,h+d-l,dashed,dashed,delta,d,w-delta,d)) + end else pdfprint("direct",f_baselined(l,o,o,w-l,h+d-l,0,d,w,d)) end |