#include "kernel.h"
#include "swis.h"

#include "font.h"

int font_exists(char *name,int x,int y)
{
  // test to see if a font is valid before setting it in a TextArea
  // if we don't, extreme badness can happen

  int handle;

  // test by trying to load the font at the desired size
  if (_swix(Font_FindFont,_INR(1,5)|_OUT(0),name,x,y,0,0,&handle)) return 0;

  // drop it immediately
  _swix(Font_LoseFont,_IN(0),&handle);

  return 1;
}
