C:Avail - FLUSH should now handle systems with >2G of memory
[AROS.git] / test / opendiskfont.c
blobac0bd550220259fba3f1a32b88e05a81d3485402
1 #include <diskfont/diskfont.h>
2 #include <proto/exec.h>
3 #include <proto/dos.h>
4 #include <proto/diskfont.h>
5 #include <proto/utility.h>
6 #include <proto/graphics.h>
8 #include <string.h>
9 #include <stdlib.h>
10 #include <stdio.h>
12 struct Library *DiskfontBase;
13 struct UtilityBase *UtilityBase;
15 UBYTE *buf;
17 void cleanup(char *msg)
19 if (msg) printf("aftest: %s\n", msg);
21 if (buf) FreeVec(buf);
23 if (UtilityBase) CloseLibrary((struct Library *)UtilityBase);
24 if (DiskfontBase) CloseLibrary(DiskfontBase);
26 exit(0);
29 void openlibs(void)
31 DiskfontBase = OpenLibrary("diskfont.library", 0);
32 if (!DiskfontBase) cleanup("Cant open diskfont.library!");
33 UtilityBase = (struct UtilityBase *) OpenLibrary("utility.library", 0);
34 if (!UtilityBase) cleanup("Cant open utility.library!");
37 void action(void)
39 struct TextFont *font;
40 struct TextAttr ta;
42 ta.ta_Name = "Vera Sans Bold Italic.font";
43 ta.ta_Name = "xhelvetica.font";
44 ta.ta_YSize = 11;
45 ta.ta_Style = 0;
46 ta.ta_Flags = 0;
48 font = OpenDiskFont(&ta);
49 if (font)
51 CloseFont(font);
55 int main(void)
57 openlibs();
58 action();
59 cleanup(0);
61 return 0; /* keep compiler happy */