FONTUSED(3R)

NAME
fontused, fontiname - font menu generator routines

SYNOPSIS
int fontused (fname)

char *fontiname (i)

char *fname;
int i;

DESCRIPTION
The fontused function tests if a given font has been requested by some process. This is a way to test if a call to fontremove will succeed. A font requested by a process cannot be removed. Fontused returns 1 if the font has been requested and 0 otherwise.

The fontiname function returns the name of the ith+1 font in the font queue. This is useful for generating a menu of fonts in the cache. If there are less than i+1 fonts, (char *)0 is returned.

EXAMPLE
The following example is a menu generator function that holds all the fonts in the cache. The fonts in use are greyed.
Titem *
fontmenu(i, m)
int i;
Tmenu *m;
{
   static Titem ti;
   int fontused();
   char *fontiname();
   if(ti.text = fontiname(i))
      ti.ufield.grey = fontused(ti.text);
   return(&ti);
}

SEE ALSO
fontname(3R), fontrequest(3R), fontsave(3L), tmenuhit(3R).