Update suitable examples and tests to use blank mode
[shapes.git] / examples / doc / blockdraw-labels.shape
blobcfbd6c132e6b40c793a4680083ec27f5d362ecd2
1 /** This file is part of Shapes.
2  **
3  ** Shapes is free software: you can redistribute it and/or modify
4  ** it under the terms of the GNU General Public License as published by
5  ** the Free Software Foundation, either version 3 of the License, or
6  ** any later version.
7  **
8  ** Shapes is distributed in the hope that it will be useful,
9  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  ** GNU General Public License for more details.
12  **
13  ** You should have received a copy of the GNU General Public License
14  ** along with Shapes.  If not, see <http://www.gnu.org/licenses/>.
15  **
16  ** Copyright 2008, 2010, 2014 Henrik Tidefelt
17  **/
19 ##needs ..Applications..Blockdraw
21 ##lookin ..Shapes
22 ##lookin ..Shapes..Geometry
23 ##lookin ..Applications..Blockdraw
25 ##unit dx = 8cm
26 ##unit dy = 2.5cm
28 z: (0cm,0cm)
30 helper: \ pos lbl →
31 [[shift pos]
32  ( Traits..@width:2bp & Traits..@stroking:Traits..RGB..RED | [Graphics..spot z] )
33  & lbl
34  & [putlabelBelow Text..@font:Text..Font..COURIER | (Text..newText << [Debug..sourceof lbl]) z+(0,~5mm) 0]
37 IO..•page << [helper (1dx,0dy) [Debug..locate [putlabelLeft [Graphics..TeX `$z$´] z ~1]]]
38 IO..•page << [helper (2dx,0dy) [Debug..locate [putlabelLeft [Graphics..TeX `$z$´] z 0]]]
39 IO..•page << [helper (3dx,0dy) [Debug..locate [putlabelLeft [Graphics..TeX `$z$´] z 1]]]
41 IO..•page << [helper (1dx,~1dy) [Debug..locate [putlabelBelow [Graphics..TeX `$z$´] z ~1]]]
42 IO..•page << [helper (2dx,~1dy) [Debug..locate [putlabelBelow [Graphics..TeX `$z$´] z 0]]]
43 IO..•page << [helper (3dx,~1dy) [Debug..locate [putlabelBelow [Graphics..TeX `$z$´] z 1]]]
45 IO..•page << [helper (1dx,~2dy) [Debug..locate [putlabelRight [Graphics..TeX `$z$´] z ~1]]]
46 IO..•page << [helper (2dx,~2dy) [Debug..locate [putlabelRight [Graphics..TeX `$z$´] z 0]]]
47 IO..•page << [helper (3dx,~2dy) [Debug..locate [putlabelRight [Graphics..TeX `$z$´] z 1]]]
49 IO..•page << [helper (1dx,~3dy) [Debug..locate [putlabelAbove [Graphics..TeX `$z$´] z ~1]]]
50 IO..•page << [helper (2dx,~3dy) [Debug..locate [putlabelAbove [Graphics..TeX `$z$´] z 0]]]
51 IO..•page << [helper (3dx,~3dy) [Debug..locate [putlabelAbove [Graphics..TeX `$z$´] z 1]]]
54  tf: [shift (2dx,~4dy)]
55  p: [hhconnect IO..•page [tf (~1cm,0cm)] [tf (1cm,0cm)] 0.5 0cm]
56  IO..•page << [putlabelAbove [Graphics..TeX `$g$´] p.begin.p ~1]
57  IO..•page << [putlabelAbove [Graphics..TeX `$G$´] p.end.p 1]
58  IO..•page << [putlabelBelow [Graphics..TeX `$x$´] p.begin.p ~1]
59  IO..•page << [putlabelBelow [Graphics..TeX `$X$´] p.end.p 1]