Difference between revisions of "Talk:Cover Pages"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
<context source="yes"> | <context source="yes"> | ||
− | + | \startMPpage | |
− | + | %------------------------------------------------------------------------------ | |
− | % | + | picture tt ; |
+ | tt := lmt_outline [ | ||
+ | kind = "fillup", | ||
+ | text = "\definedfont[name:texgyrepagellabold*default]% | ||
+ | \framed[frame=off,offset=3mm,align=normal,strut=none] | ||
+ | {MetaPost is Fun ! @\\ Aujourd'hui\\Today}", | ||
+ | ] xsized 20cm ; | ||
− | + | path bb ; bb := boundingbox tt; | |
− | |||
− | |||
− | |||
− | |||
− | %------------------------------------------------------------------------------ | + | %------------------------------------------------------------------------------ |
− | + | path pp ; pp := bb enlarged 1cm ; | |
+ | fill pp | ||
+ | withshademethod "linear" | ||
+ | withshadedirection right | ||
+ | withshadecolors (red, blue); | ||
+ | |||
+ | %------------------------------------------------------------------------------ | ||
− | + | picture Paddmissing; Paddmissing := nullpicture; | |
− | + | picture Pwoletters; Pwoletters := nullpicture; | |
− | + | color colorframe; colorframe := 0.15white; | |
− | + | 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 colorframe; | ||
+ | else: | ||
+ | addto Pwoletters contour | ||
+ | (pathpart i) | ||
+ | withpostscript "collect"; | ||
+ | fi; | ||
− | + | fi ; | |
+ | endfor ; | ||
− | + | %------------------------------------------------------------------------------ | |
− | + | ||
− | + | addto Pwoletters contour | |
− | + | bb | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | addto | ||
− | |||
withpostscript "evenodd" | withpostscript "evenodd" | ||
− | withcolor | + | withcolor colorframe; |
− | draw | + | draw Pwoletters ; |
− | draw | + | draw Paddmissing ; |
− | + | ||
− | + | \stopMPpage | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | \ | ||
</context> | </context> |
Revision as of 16:48, 24 December 2020
A test
\startMPpage %------------------------------------------------------------------------------ picture tt ; tt := lmt_outline [ kind = "fillup", text = "\definedfont[name:texgyrepagellabold*default]% \framed[frame=off,offset=3mm,align=normal,strut=none] {MetaPost is Fun ! @\\ Aujourd'hui\\Today}", ] xsized 20cm ; path bb ; bb := boundingbox tt; %------------------------------------------------------------------------------ path pp ; pp := bb enlarged 1cm ; fill pp withshademethod "linear" withshadedirection right withshadecolors (red, blue); %------------------------------------------------------------------------------ picture Paddmissing; Paddmissing := nullpicture; picture Pwoletters; Pwoletters := nullpicture; color colorframe; colorframe := 0.15white; 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 colorframe; else: addto Pwoletters contour (pathpart i) withpostscript "collect"; fi; fi ; endfor ; %------------------------------------------------------------------------------ addto Pwoletters contour bb withpostscript "evenodd" withcolor colorframe; draw Pwoletters ; draw Paddmissing ; \stopMPpage