home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_progs
/
prog_c
/
suplib.lzh
/
SUPLIB
/
SRC
/
GETFONT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-16
|
741b
|
46 lines
/*
* This function properly searches resident and disk fonts for the
* font.
*
*/
#include <local/typedefs.h>
#include <local/xmisc.h>
extern struct Library *DiskfontBase;
FONT *
GetFont(name, size)
char *name;
short size;
{
register FONT *font1;
TA Ta;
short libwasopen = (DiskfontBase != NULL);
Ta.ta_Name = (ubyte *)name;
Ta.ta_YSize = size;
Ta.ta_Style = 0;
Ta.ta_Flags = 0;
font1 = OpenFont(&Ta);
if (font1 == NULL || font1->tf_YSize != Ta.ta_YSize) {
register FONT *font2;
if (openlibs(DISKFONT_LIB)) {
if (font2 = OpenDiskFont(&Ta)) {
if (font1)
CloseFont(font1);
font1 = font2;
}
if (!libwasopen)
closelibs(DISKFONT_LIB);
}
}
return(font1);
}