1 /** This file is part of Shapes.
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
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.
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/>.
16 ** Copyright 2008 Henrik Tidefelt
19 ##needs rtlogo_elements
23 |** Give the line you want to measure as the first argument to bboxed, and
24 |** look in the resulting graphics to measure the text in <textSize> units.
26 @<< [bboxed line0 [rectangle (0cm,~1cm) (rulerLength,textSize+1cm)]]
29 |** The rest of this file just defines the ruler.
33 [[range 1 rulerLength/step-0.5].foldl
35 @<< [stroke (e*step,0)--(+(0,~3mm))]
36 @<< [shift (e*step-2mm,~9mm)] [] ( HotText << @text_size:8bp | [kerning [sprintf `%gsz´ e]] )
46 [[range 1 rulerLength/step-0.5].foldl
48 @<< [stroke (e*step,textSize)--((+0mm),~1mm)]
58 [[range 1 rulerLength/step-0.5].foldl
60 @<< [stroke (e*step,0.5*textSize)--((+0mm),~3mm)]