-
Notifications
You must be signed in to change notification settings - Fork 1
/
Fl_GetFontSizes01_no.nim
55 lines (42 loc) · 1.08 KB
/
Fl_GetFontSizes01_no.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os
import fltk_main
#~ ' test of:
#~ ' Fl_GetFontSizes
var
fontName: cstring
attributes: long
defaultSize: long
fontSize: long
fontsizes: ptr long
#~ ' load font list
var nFonts = Fl_SetFonts()
var
i: long
j: integer
for i in 0 .. nFonts-1:
fontName = Fl_GetFontName(i, addr(attributes))
if len(fontName) > 0 and fontName[0] != '@' :
echo $i & " " & $fontName & " "
case attributes:
of FL_BOLD :
echo "is bold "
of FL_ITALIC :
echo "is italic "
of FL_BOLD_ITALIC :
echo "is bold and italic "
else:
discard
defaultSize = Fl_GetFontSizes(i, fontsizes)
if (defaultSize > 1) and (not fontsizes.isNil) :
echo "font has fixed sizes: "
fontSize = fontsizes[j]
while fontSize.len > 0:
if (fontSize=defaultSize) :
echo "[" & $fontSize & "] "
else:
echo $(fontSize) & " "
j += 1
fontSize=fontsizes[j]
sleep 700
sleep 300
echo