summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/mp-core.mp2
-rw-r--r--metapost/context/mp-spec.mp37
-rw-r--r--metapost/context/mp-tool.mp10
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 ;