Difference between revisions of "Talk:Cover Pages"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
<context source="yes"> | <context source="yes"> | ||
+ | \definecolor [ColorHighA] [h=c4a000] | ||
+ | \definecolor [ColorHighB] [h=602217] | ||
+ | \definecolor [ColorLow] [0.8(white)] | ||
+ | |||
\startMPpage | \startMPpage | ||
Line 10: | Line 14: | ||
kind = "fillup", | kind = "fillup", | ||
text = "\definedfont[name:texgyrepagellabold*default]% | text = "\definedfont[name:texgyrepagellabold*default]% | ||
− | \framed[frame=off,offset=3mm,align= | + | \framed[frame=off,offset=3mm,align=middle,strut=none] |
− | {MetaPost is Fun !\\Aujourd'hui\\Today\\ | + | {MetaPost\\is Fun !\\Aujourd'hui\\Today\\*§ 2020 §*}", |
− | ] xsized | + | ] xsized 20cm ; |
path bb ; bb := boundingbox tt; | path bb ; bb := boundingbox tt; | ||
Line 18: | Line 22: | ||
%------------------------------------------------------------------------------ | %------------------------------------------------------------------------------ | ||
− | path pp ; pp := bb enlarged | + | path pp ; pp := bb enlarged 2cm ; |
fill pp | fill pp | ||
withshademethod "linear" | withshademethod "linear" | ||
− | withshadedirection | + | withshadedirection (2.,0.) |
− | withshadecolors ( | + | withshadecolors (\MPcolor{ColorHighA}, \MPcolor{ColorHighB}); |
%------------------------------------------------------------------------------ | %------------------------------------------------------------------------------ | ||
Line 28: | Line 32: | ||
picture Paddmissing; Paddmissing := nullpicture; | picture Paddmissing; Paddmissing := nullpicture; | ||
picture Pwoletters; Pwoletters := nullpicture; | picture Pwoletters; Pwoletters := nullpicture; | ||
− | |||
numeric testwithin ; | numeric testwithin ; | ||
Line 52: | Line 55: | ||
addto Paddmissing contour | addto Paddmissing contour | ||
(pathpart i) | (pathpart i) | ||
− | withcolor | + | withcolor \MPcolor{ColorLow}; |
else: | else: | ||
addto Pwoletters contour | addto Pwoletters contour | ||
Line 67: | Line 70: | ||
bb | bb | ||
withpostscript "evenodd" | withpostscript "evenodd" | ||
− | withcolor | + | withcolor \MPcolor{ColorLow}; |
draw Pwoletters ; | draw Pwoletters ; | ||
draw Paddmissing ; | draw Paddmissing ; |
Revision as of 16:58, 24 December 2020
A test
\definecolor [ColorHighA] [h=c4a000] \definecolor [ColorHighB] [h=602217] \definecolor [ColorLow] [0.8(white)] \startMPpage %------------------------------------------------------------------------------ picture tt ; tt := lmt_outline [ kind = "fillup", text = "\definedfont[name:texgyrepagellabold*default]% \framed[frame=off,offset=3mm,align=middle,strut=none] {MetaPost\\is Fun !\\Aujourd'hui\\Today\\*§ 2020 §*}", ] xsized 20cm ; path bb ; bb := boundingbox tt; %------------------------------------------------------------------------------ path pp ; pp := bb enlarged 2cm ; fill pp withshademethod "linear" withshadedirection (2.,0.) withshadecolors (\MPcolor{ColorHighA}, \MPcolor{ColorHighB}); %------------------------------------------------------------------------------ picture Paddmissing; Paddmissing := nullpicture; picture Pwoletters; Pwoletters := nullpicture; numeric testwithin ; %------------------------------------------------------------------------------ for i within tt : if stroked i or filled i : testwithin :=0; for j within tt : if stroked j or filled j: if (((xpart llcorner i) > (xpart llcorner j)) and ((ypart llcorner i) > (ypart llcorner j)) and ((xpart urcorner i) < (xpart urcorner j)) and ((ypart urcorner i) < (ypart urcorner j))) : testwithin :=1; fi; fi; endfor; if testwithin == 1: addto Paddmissing contour (pathpart i) withcolor \MPcolor{ColorLow}; else: addto Pwoletters contour (pathpart i) withpostscript "collect"; fi; fi ; endfor ; %------------------------------------------------------------------------------ addto Pwoletters contour bb withpostscript "evenodd" withcolor \MPcolor{ColorLow}; draw Pwoletters ; draw Paddmissing ; \stopMPpage