Debian Codegraph @

test/sys/graphicsText.praat

raw
1 # graphicsText.praat
2 # Paul Boersma 2021-10-27
3
4 Erase all
5 Select outer viewport: 0, 9, 0, 9
6 Axes: 0, 100, 50, 100
7 Times
8 12
9
10 width = Text width (mm): "Hello world"
11 writeInfoLine: "width ", width, " mm"
12
13 Text: 0, "left", 99, "half", "Getting graphical text right is not a trivial task:"
14 Text: 0, "left", 98, "half", "many types of glitches are possible."
15 Text: 0, "left", 96, "half", "Code might be misaligned as in: $$< > <> <= = >=$, you see?"
16 Courier
17 text$ = "Code might be misaligned as in: $$< > <> <= = >=$, you see?"
18 Text: 0, "left", 95, "half", text$
19 width = Text width (mm): text$
20 appendInfoLine: "width ", width, " mm"
21 width = Text width (world coordinates): text$
22 appendInfoLine: "width ", width
23 Text: width, "left", 94, "half", "... and here it continues:"
24 Text: 0, "left", 93, "half", "a / b, a/b, a / b, a/b, a / b, a/b, a / b, a /b, a/ b"
25 Times
26 Text: 0, "left", 92, "half", "a / b, a/b, a / b"
27 Courier
28 Text: 0, "left", 90, "half", "The space might be too small in: Now %%you% try. and/or"
29 Times
30 Text: 0, "left", 89, "half", "The space might be too small in: Now %%you% try. and/or"
31
32 Text: 0, "left", 88, "half", "A lot of normal text might cause ##misalignment# misalignment misalignment of the f in: (%%false%)"
33 Text: 0, "left", 87, "half", "(%%false%) now at the beginning of the line"
34
35 Text: 0, "left", 85, "half", "n\|v b\0v o\Tv o\T^ o\T( o\T) e\-v o\+v o\:v o\~v d\Nv d\Uv u\nv e\3v u\cv///"
36 Text: 0, "left", 83, "half", "\gf\0^ \ef\'^ \ef\`^ \ef\-^ \ef\~^ \ef\v^ \ef\^^ o\:^ e\x^ \ef\N^ k\lip t\lis a\_ub///"
37 Text: 0, "left", 81, "half", "t\^h b\^H t\^g k\^w t\^Y a\^? t\^9 t\^l t\^n p\^m k\^N t\^s k\^x p\^f t\^y///"
38 Text: 0, "left", 79, "half", "\ts \tS///"
39
40 Save as 600-dpi PNG file: "kanweg.png"
41 Save as EPS file: "kanweg.eps"
42
43
44
45 width = Text width (mm): "Hello world"
46 assert width > 18.0 and width < 26.0 ; 'width'
47 appendInfoLine: "width ", width, " mm"
48 appendInfoLine: "OK"