diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
commit | 65d009a0596b194597f47531523addd3e64ed005 (patch) | |
tree | e13bd9beecf63e26491a66aa7a8fa702482f0067 /Master/texmf-dist/metapost/context/base/mpiv/mp-crop.mpiv | |
parent | d1a186333ced7b341e26877907343f08211199f7 (diff) |
context [current] (20mar18)
git-svn-id: svn://tug.org/texlive/trunk@47050 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost/context/base/mpiv/mp-crop.mpiv')
-rw-r--r-- | Master/texmf-dist/metapost/context/base/mpiv/mp-crop.mpiv | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Master/texmf-dist/metapost/context/base/mpiv/mp-crop.mpiv b/Master/texmf-dist/metapost/context/base/mpiv/mp-crop.mpiv index 00bcdcb4454..e06cf8defa2 100644 --- a/Master/texmf-dist/metapost/context/base/mpiv/mp-crop.mpiv +++ b/Master/texmf-dist/metapost/context/base/mpiv/mp-crop.mpiv @@ -15,7 +15,7 @@ if known context_crop : endinput ; fi ; boolean context_crop ; context_crop := true ; -vardef crop_marks_lines (expr box, len, offset, nx, ny) = +vardef crop_marks_lines (expr box, len, offset, nx, ny, boxtoo) = save p ; picture p ; save w, h, x, y ; numeric w, h, x, y ; p := image ( x := if nx = 0 : 1 else : nx - 1 fi ; @@ -30,12 +30,20 @@ vardef crop_marks_lines (expr box, len, offset, nx, ny) = draw ((llcorner box) -- (llcorner box) shifted (0,-len)) shifted (i*w,-offset) ; draw ((ulcorner box) -- (ulcorner box) shifted (0, len)) shifted (i*w, offset) ; endfor ; + if boxtoo : + for i=0 upto x-1 : + for j=0 upto y-1 : + draw box enlarged 1/8 shifted (i*w,j*h) dashed evenly withpen pencircle scaled 1/4 ; + endfor ; + endfor ; + fi ; ) ; setbounds p to box ; p enddef ; vardef crop_marks_cmyk = + pickup pencircle scaled 1/2 ; save p ; picture p ; p := image ( fill ulcircle scaled 12.5 withcolor (1,0,0,0) ; fill urcircle scaled 12.5 withcolor (0,1,0,0) ; @@ -125,6 +133,8 @@ enddef ; def page_marks_add_color(expr width, height, length, offset) = % todo: namespace + pickup pencircle scaled 1/2 ; interim linecap := squared ; interim linejoin := butt ; + path page ; page := fullsquare xscaled width yscaled height ; path more ; more := page enlarged (offset+length/2,offset+length/2) ; @@ -159,6 +169,8 @@ enddef ; def page_marks_add_marking(expr width, height, length, offset) = % todo: namespace + pickup pencircle scaled 1/2 ; interim linecap := squared ; interim linejoin := butt ; + path page ; page := fullsquare xscaled width yscaled height ; path more ; more := page enlarged (offset+length/2,offset+length/2) ; @@ -169,12 +181,14 @@ def page_marks_add_marking(expr width, height, length, offset) = % todo: namespa enddef ; -def page_marks_add_lines(expr width, height, length, offset, nx, ny) = % todo: namespace +def page_marks_add_lines(expr width, height, length, offset, nx, ny, boxtoo) = % todo: namespace + + pickup pencircle scaled 1/2 ; interim linecap := squared ; interim linejoin := butt ; path page ; page := fullsquare xscaled width yscaled height ; path more ; more := page enlarged (offset+length/2,offset+length/2) ; - draw crop_marks_lines(page,length,offset,nx,ny) ; + draw crop_marks_lines(page,length,offset,nx,ny,boxtoo) ; setbounds currentpicture to page ; @@ -182,6 +196,8 @@ enddef ; def page_marks_add_number(expr width, height, length, offset, n) = % todo: namespace + pickup pencircle scaled 1/2 ; interim linecap := squared ; interim linejoin := butt ; + path page ; page := fullsquare xscaled width yscaled height ; path more ; more := page enlarged (offset+length/2,offset+length/2) ; |