Re: color stack overflow

"Akira Kakuto" <[email protected]>
Newsgroups gmane.comp.tex.metapost
Message-ID <CEDFE34F86B94228AFF957F81A0492AF@CJ3001517A>
> ok, but before to patch the code I have  to see why we go beyond the
> max_color_stack_depth.
> Could be a problem of macro package.

The example by Christophe seems to be correct.

I show below results of my experiment (by using MetaPost 0.641).

[1] change of dvitomp
max_color_stack_depth = 11
  color stack overflow occurs
max_color_stack_depth = 12
  There is no error. Resulting EssaiNew.1 is OK.

[2] consistency of the example
mpto -tex mptextmp.mp >mptextmp.tex
latex mptextmp.tex
dvitype mptextmp.dvi >mptextmp.txt

The file mptextmp.txt shows:

Number of 'color push' command = 16
Number of 'color pop'  command = 16

I attach the file mptextmp.txt.

Best,
Akira

--
http://tug.org/metapost/
mptextmp.txt (text/plain, 4 KB)
This is DVItype, Version 3.6 (TeX Live 2017/W32TeX)
Options selected:
  Starting page = * 
  Maximum number of pages = 1000000
  Output level = 4 (the works)
  Resolution = 300.00000000 pixels per inch
numerator/denominator=25400000/473628672
magnification=1000;       0.00006334 pixels per DVI unit
' TeX output 2017.04.10:1644'
Postamble starts at byte 793.
maxv=0, maxh=2752225, maxstackdepth=6, totalpages=1
Font 16: ecbx1200---loaded at size 786432 DVI units 
 
42: beginning of page 1 
87: push 
level 0:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
88: push 
level 1:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
89: xxx 'color push rgb 0.359 0.715 0.07' 
122: xxx 'color push rgb 0.359 0.715 0.07' 
155: push 
level 2:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
156: down3 786432 v:=0+786432=786432, vv:=50 warning: |v|>0! 
160: setrule height 2115588, width 2752224 (135x175 pixels) 
 h:=0+2752224=2752224, hh:=175 
169: pop 
level 2:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
170: xxx 'color pop' 
181: push 
level 2:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
182: w3 196608 h:=0+196608=196608, hh:=12 
[ ]
186: xxx 'color push gray 0' 
205: xxx 'color push gray 1' 
224: xxx 'color push gray 1' 
243: xxx 'color push gray 1' 
262: push 
level 3:(h=196608,v=0,w=196608,x=0,y=0,z=0,hh=12,vv=0) 
263: down3 589824 v:=0+589824=589824, vv:=37 
267: setrule height 1722372, width 2359008 (110x150 pixels) 
 h:=196608+2359008=2555616, hh:=162 
276: pop 
level 3:(h=196608,v=0,w=196608,x=0,y=0,z=0,hh=12,vv=0) 
277: xxx 'color pop' 
288: push 
level 3:(h=196608,v=0,w=196608,x=0,y=0,z=0,hh=12,vv=0) 
289: w0 196608 h:=196608+196608=393216, hh:=25 
[ ]
290: xxx 'color push gray 1' 
309: xxx 'color push gray 0' 
328: xxx 'color push rgb 0.289 0.422 0.828' 
362: xxx 'color push rgb 0.289 0.422 0.828' 
396: push 
level 4:(h=393216,v=0,w=196608,x=0,y=0,z=0,hh=25,vv=0) 
397: down3 393216 v:=0+393216=393216, vv:=25 
401: setrule height 1329156, width 1965792 (85x125 pixels) 
 h:=393216+1965792=2359008, hh:=150 
410: pop 
level 4:(h=393216,v=0,w=196608,x=0,y=0,z=0,hh=25,vv=0) 
411: xxx 'color pop' 
422: push 
level 4:(h=393216,v=0,w=196608,x=0,y=0,z=0,hh=25,vv=0) 
423: w0 196608 h:=393216+196608=589824, hh:=37 
[ ]
424: xxx 'color push gray 0' 
443: xxx 'color push gray 1' 
462: xxx 'color push rgb 0.54 0.332 0.84' 
494: xxx 'color push rgb 0.54 0.332 0.84' 
526: push 
level 5:(h=589824,v=0,w=196608,x=0,y=0,z=0,hh=37,vv=0) 
527: down3 196608 v:=0+196608=196608, vv:=12 
531: setrule height 935940, width 1572576 (60x100 pixels) 
 h:=589824+1572576=2162400, hh:=137 
540: pop 
level 5:(h=589824,v=0,w=196608,x=0,y=0,z=0,hh=37,vv=0) 
541: xxx 'color pop' 
552: push 
level 5:(h=589824,v=0,w=196608,x=0,y=0,z=0,hh=37,vv=0) 
553: w0 196608 h:=589824+196608=786432, hh:=50 
[ ]
554: xxx 'color push gray 1' 
573: xxx 'color push gray 1' 
592: fntdef1 16: ecbx1200 
616: fntnum16 current font is ecbx1200 
617: setchar116 h:=786432+343980=1130412, hh:=72 
618: setchar105 h:=1130412+245700=1376112, hh:=88 
619: setchar116 h:=1376112+343980=1720092, hh:=110 
620: setchar105 h:=1720092+245700=1965792, hh:=126 
[titi]
621: xxx 'color pop' 
632: xxx 'color pop' 
643: pop 
level 5:(h=589824,v=0,w=196608,x=0,y=0,z=0,hh=37,vv=0) 
644: right3 1572576 h:=589824+1572576=2162400, hh:=137 
[ ]
648: xxx 'color pop' 
659: xxx 'color pop' 
670: xxx 'color pop' 
681: pop 
level 4:(h=393216,v=0,w=196608,x=0,y=0,z=0,hh=25,vv=0) 
682: right3 1965792 h:=393216+1965792=2359008, hh:=149 
[ ]
686: xxx 'color pop' 
697: xxx 'color pop' 
708: xxx 'color pop' 
719: pop 
level 3:(h=196608,v=0,w=196608,x=0,y=0,z=0,hh=12,vv=0) 
720: right3 2359008 h:=196608+2359008=2555616, hh:=162 
[ ]
724: xxx 'color pop' 
735: xxx 'color pop' 
746: xxx 'color pop' 
757: pop 
level 2:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
758: right3 2752224 h:=0+2752224=2752224, hh:=174 
[ ]
762: xxx 'color pop' 
773: pop 
level 1:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
774: right3 2752224 h:=0+2752224=2752224, hh:=174 
[ ]
778: down3 786432 v:=0+786432=786432, vv:=50 
782: setrule height 2115588, width 1 (135x1 pixels) 
 h:=2752224+1=2752225, hh:=175 
791: pop 
level 0:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
792: eop
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.