diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-03-12 18:45:40 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-03-12 18:45:40 +0100 |
commit | 188632f4b0f71c5170a20f1b151bde68f603bfd9 (patch) | |
tree | 49a5a917a1ce6f17cbb6f542dff5b8254cd74c70 /tex/context/base/mkxl/lpdf-rul.lmt | |
parent | b7a7de31716616b7a5176259e2b60349f8089615 (diff) | |
download | context-188632f4b0f71c5170a20f1b151bde68f603bfd9.tar.gz |
2022-03-12 11:26:00
Diffstat (limited to 'tex/context/base/mkxl/lpdf-rul.lmt')
-rw-r--r-- | tex/context/base/mkxl/lpdf-rul.lmt | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tex/context/base/mkxl/lpdf-rul.lmt b/tex/context/base/mkxl/lpdf-rul.lmt index 96b4597bb..1dfcc11a3 100644 --- a/tex/context/base/mkxl/lpdf-rul.lmt +++ b/tex/context/base/mkxl/lpdf-rul.lmt @@ -376,7 +376,29 @@ h %s]] 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)) + 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 + 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)) + 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 |