diff options
author | Hans Hagen <pragma@wxs.nl> | 2001-04-09 00:00:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2001-04-09 00:00:00 +0200 |
commit | 097d775537de422f644e9d13a40a3b18bf7dfe91 (patch) | |
tree | 24871ebb9648fabc5ac88f4003edfa2005a3b3d3 /metapost | |
parent | 2a2e86e6c2022e3925e0ee62f5c7b66bbec03338 (diff) | |
download | context-097d775537de422f644e9d13a40a3b18bf7dfe91.tar.gz |
stable 2001.04.09
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/mp-core.mp | 2 | ||||
-rw-r--r-- | metapost/context/mp-spec.mp | 37 | ||||
-rw-r--r-- | metapost/context/mp-tool.mp | 10 |
3 files changed, 46 insertions, 3 deletions
diff --git a/metapost/context/mp-core.mp b/metapost/context/mp-core.mp index d4045d3da..3bc42ee74 100644 --- a/metapost/context/mp-core.mp +++ b/metapost/context/mp-core.mp @@ -24,6 +24,8 @@ def box_found (expr n,x,y,w,h,d) = not ((x=0) and (y=0) and (w=0) and (h=0) and (d=0)) enddef ; +% left / right page problem ! ! ! ! ! + def initialize_box_pos (expr pos,n,x,y,w,h,d) = pair lxy, rxy, cxy, llxy, lrxy, ulxy, urxy ; path pxy ; numeric hxy, wxy, dxy, nxy; diff --git a/metapost/context/mp-spec.mp b/metapost/context/mp-spec.mp index b23164c14..db7cbd256 100644 --- a/metapost/context/mp-spec.mp +++ b/metapost/context/mp-spec.mp @@ -227,4 +227,41 @@ enddef ; % % \blank Does it work or not? +_cmyk_counter_ := 0 ; + +numeric cmykcolorhash[][][][] ; + +boolean cmykcolors ; % cmykcolors := true ; + +let normalcmyk = cmyk ; % see mp-tool.mp + +vardef cmyk(expr c,m,y,k) = + if cmykcolors : + if not known cmykcolorhash[c][m][y][k] : + _cmyk_counter_ := _cmyk_counter_ + 1 ; + cmykcolorhash[c][m][y][k] := _cmyk_counter_ ; + flush_special(1, 7, + decimal _cmyk_counter_ & " " & + decimal c & " " & + decimal m & " " & + decimal y & " " & + decimal k) ; + fi + (_special_signal_/1000,1/1000,cmykcolorhash[c][m][y][k]/1000) + else : + normalcmyk(1-c-k,1-m-k,1-y-k) + fi +enddef ; + +%D Basic position tracking: + +def register (expr label, width, height, offset) = + begingroup ; + flush_special(50, 7, + ddecimal offset & " " & + decimal width & " " & + decimal height & " " & label) ; + endgroup ; +enddef ; + endinput ; diff --git a/metapost/context/mp-tool.mp b/metapost/context/mp-tool.mp index 958cc3903..76c7708cf 100644 --- a/metapost/context/mp-tool.mp +++ b/metapost/context/mp-tool.mp @@ -1031,8 +1031,6 @@ vardef thefreelabel (expr str, loc, ori) = (s shifted -l) enddef ; - - vardef freelabel (expr str, loc, ori) = draw thefreelabel(str,loc,ori) ; enddef ; @@ -1040,7 +1038,7 @@ enddef ; vardef freedotlabel (expr str, loc, ori) = interim linecap:=rounded ; draw loc withpen pencircle scaled freedotlabelsize ; - freelabel(str,loc,ori) ; + draw thefreelabel(str,loc,ori) ; enddef ; %D \starttypen @@ -1459,6 +1457,12 @@ primarydef p cornered c = endfor cycle) enddef ; +% cmyk color support + +vardef cmyk(expr c,m,y,k) = + (1-c-k,1-m-k,1-y-k) +enddef ; + % done endinput ; |