summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-core.mpiv11
-rw-r--r--metapost/context/base/mp-page.mpiv11
2 files changed, 21 insertions, 1 deletions
diff --git a/metapost/context/base/mp-core.mpiv b/metapost/context/base/mp-core.mpiv
index 2d1a80759..25ad04abb 100644
--- a/metapost/context/base/mp-core.mpiv
+++ b/metapost/context/base/mp-core.mpiv
@@ -348,6 +348,7 @@ boolean obey_multi_par_hang ; obey_multi_par_hang := true ;
boolean obey_multi_par_more ; obey_multi_par_more := true ;
boolean snap_multi_par_tops ; snap_multi_par_tops := true ;
boolean local_multi_par_area ; local_multi_par_area := false ;
+boolean use_multi_par_region ; use_multi_par_region := false ;
boolean ignore_multi_par_page ; ignore_multi_par_page := false ;
boolean force_multi_par_chain ; force_multi_par_chain := true ;
boolean one_piece_multi_par ; one_piece_multi_par := false ;
@@ -374,6 +375,9 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
pn,px,py,pw,ph,pd,
rw,rl,rr,rh,ra,ri) =
+% fill PlainTextArea withcolor red ;
+% fill RegionTextArea withcolor green;
+
if span_multi_column_pars :
begingroup ;
save TextAreas ; path TextAreas[] ;
@@ -398,6 +402,13 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
TextAreas[1] := TextAreas[0] ;
TextColumns[1] := TextColumns[0] ;
nxy[fpos] := nxy[tpos] := nxy[wpos] := nxy[ppos] := RealPageNumber ;
+ elseif use_multi_par_region :
+ RealPageNumber := fn ;
+ NOfTextAreas := 1 ;
+ NOfSavedTextAreas := 0 ;
+ TextAreas[1] := RegionTextArea ;
+ TextColumns[1] := RegionTextArea ;
+ nxy[fpos] := nxy[tpos] := nxy[wpos] := nxy[ppos] := RealPageNumber ;
elseif ignore_multi_par_page :
RealPageNumber := fn ;
nxy[fpos] := nxy[tpos] := nxy[wpos] := nxy[ppos] := RealPageNumber ;
diff --git a/metapost/context/base/mp-page.mpiv b/metapost/context/base/mp-page.mpiv
index e33324b0e..ba6dcd6a5 100644
--- a/metapost/context/base/mp-page.mpiv
+++ b/metapost/context/base/mp-page.mpiv
@@ -54,7 +54,7 @@ def SaveTextAreas =
enddef ;
def ResetTextAreas =
- path TextAreas[], TextColumns[] ;
+ path TextAreas[], TextColumns[], PlainTextArea, RegionTextArea ;
numeric NOfTextAreas ; NOfTextAreas := 0 ;
numeric NOfTextColumns ; NOfTextColumns := 0 ;
numeric nofmultipars ; nofmultipars := 0 ;
@@ -103,6 +103,15 @@ enddef ;
%D We store a local area in slot zero.
+def RegisterPlainTextArea(expr x,y,w,h,d) =
+ PlainTextArea := unitsquare xyscaled(w,h+d) shifted (x,y-d) ;
+enddef ;
+
+def RegisterRegionTextArea(expr x,y,w,h,d) =
+ RegionTextArea := unitsquare xyscaled(w,h+d) shifted (x,y-d) ;
+% RegionTextArea := RegionTextArea enlarged 2mm ;
+enddef ;
+
def RegisterLocalTextArea (expr x, y, w, h, d) =
TextAreas[0] := TextColumns[0] := unitsquare xyscaled(w,h+d) shifted (x,y-d) ;
enddef ;