NUMERIC DIGITS 10
OPTIONS "WINFUNC NOSOURCE C_CALL"
DO
logfont = "32, 32, 32, 32, 32, 8, 8, 8, 8, 8, 8, 8, 8, str[32]"
choosefont = "32u, void, void, struct LOGFONT * stor, 32, 32u, 32u, 32u, void, void, void, void, 16u, 16u, 32, 32"
FUNCDEF("ChooseFont", "32u, struct CHOOSEFONT", "comdlg32")
CATCH FAILURE
CONDITION("M")
RETURN
END
choosefont. = 0
choosefont.1 = 60
choosefont.6 = 1 + 65536 + 4
err = choosefont(choosefont)
IF err \== 0 THEN DO
SAY "Font height:" choosefont.4.1
SAY "Font width:" choosefont.4.2
SELECT
WHEN choosefont.4.5 = 300 THEN SAY "Font weight: Light"
WHEN choosefont.4.5 = 400 THEN SAY "Font weight: Normal"
WHEN choosefont.4.5 = 700 THEN SAY "Font weight: Bold"
OTHERWISE SAY "Font weight:" choosefont.4.5
END
IF choosefont.4.6 == 1 THEN SAY "Italic"
IF choosefont.4.7 == 1 THEN SAY "Underlined"
IF choosefont.4.8 == 1 THEN SAY "Strike out"
SAY "Font name:" choosefont.4.14
END
ELSE SAY "ERROR: Presenting Font dialog"
RETURN |