Introducing a logo for Shapes.
[shapes.git] / examples / applications / rtlogo_round_gray.shape
blob5947f78c8813b64bc9cbe964c3108d1ce193f2c0
1 |***************************************************************************
2 |** This is a file that is used to generate a particular form of the logo.
3 |**
4 |** This form of the logo has bent text above and below, and looks rather
5 |** different from the other logos.  It can be used in printed material like
6 |** theses, course material, and books.  (The other logos are used in
7 |** presentations and posters.)
8 |**
9 |** This file requires rtlogo_elements, which is not part of Shapes.
10 |***************************************************************************
11 ##author Henrik Tidefelt
13 ##needs rtlogo_elements
14 ##needs circle
16 /** This is the text size, and everything related to the text should be in this unit so that it
17  ** becomes easy to change the size of the text circle relative to the regulator inside.
18  **/
19 ##unit t = 10bp
20 ##unit rR = 13mm |** This is the size given to makeRegulator function.
22 smallFont: @text_font:FONT_HELVETICA_BOLD & @text_size:1t & @text_horizontalscaling:1.0
24 |** The bent text is drawn along circular arcs, and we put the text in contact with the regulator's box at
25 |** the center coordinate.
26 circleCenter: (0,0.92rR)
27 innerRadius: 4.4t
28 charHeight: [ymax [bbox smallFont | ( newText << `X´ )]]
29 outerRadius: innerRadius + charHeight
30 ballSpace: 0.22
31 graySep: 0.3t
34 •page << @nonstroking:lightGray | [fill [shift circleCenter][][circle outerRadius + graySep]]
35 •page << @nonstroking:darkGray | [fill [shift circleCenter][][circle innerRadius - graySep]]
38   @stroking:GRAY_WHITE
39 & @nonstroking:GRAY_WHITE
42   /** Recall where this places the regulator...
43    **/
44   [makeRegulator 1rR •page]
48   /** This is the upper banner.
49    ** Since the text is placed on the outside of the circle, no special kerning should be needed.
50    **/
52   text: smallFont | [kerning `•´ ~ballSpace [kern `REGLERTEKNIK´] ~ballSpace `•´ ~ballSpace [kern `AUTOM´] 0.08 `A´ 0.13 [kern `TIC CONTROL´] ~ballSpace `•´]
53   baseline: [shift circleCenter] [] [rotate 90° + 0.5*[xmax [bbox ( newText << text )]]/innerRadius] [] reverse [] [circle innerRadius]
55 |**  •page << @width:0bp & @stroking:RGB_RED | [stroke baseline]
56 |**  •page << @width:0bp | [stroke (~1r,[baseline 0].p.y)--(1r,(+0r))]
58   /** At the time of writing, there is no abstraction for placing text along a path, but this is the
59    ** standard way of doing it.
60    **/
61   •page <<
62    [text.list.foldl
63       \ pile distChar .>
64        {
65          c: ( newText << distChar.cdr )
66          sl: [baseline distChar.car + 0.5*[xmax [bbox c]]]
67          pile
68          &
69          [[shift sl.p]()[rotate [angle sl.T]] [centerx c] ]
70        }
71       null]
75   /** This is the lower banner.
76    ** Since the text is placed on the inside of the circle, some negative kerning must be used.
77    **/
78   stdkern: charHeight/outerRadius
80   text: smallFont | ( @text_characterspacing:stdkern*@text_size | [kerning [kern `LINK´] 0.13 `Ö´ 0.03 [kern `PING´]] )
82   baseline: [shift circleCenter] [] [rotate ~90° - 0.5*([xmax [bbox (newText << text)]])/outerRadius] [] [circle outerRadius]
84   /** At the time of writing, there is no abstraction for placing text along a path, but this is the
85    ** standard way of doing it.
86    **/
87   •page <<
88    [text.list.foldl
89       \ pile distChar .>
90        {
91          c: ( newText << distChar.cdr )
92          sl: [baseline distChar.car + 0.5*[xmax [bbox c]]]
93          pile
94          &
95          [[shift sl.p]()[rotate [angle sl.T]] [centerx c] ]
96        }
97       null]