home *** CD-ROM | disk | FTP | other *** search
- /* > $.CLIB.C.fonts
- *
- * HASWIN Graphics Library
- * =========================
- *
- * Copyright (C) H.A.Shaw 1990.
- * Howard A. Shaw.
- * The Unit for Space Sciences,
- * Room 165,
- * Physics Building,
- * University of Kent at Canterbury.
- * Canterbury.
- * Kent. CT2 7NJ
- * You may use and distribute this code freely, however please leave
- * it alone. If you find bugs (and there will be many) please contact
- * me and the master source can be modified. If you keep me informed
- * of who you give copies of this to then I can get release upgrades
- * to them.
- *
- * font system control routines.
- */
- #include "includes.h"
-
- void haswin_finishedfonts() {
-
- int fnum, fcnt;
- _kernel_swi_regs regs;
-
- /* use Font_LoseFont to remove fonts */
- for (fnum=0; fnum<256; fnum++) {
- for(fcnt=0; fcnt<(int)haswin_fontarray[fnum]; fcnt++) {
- regs.r[0] = fnum;
- if (!haswin_swi(FONT_Lose_font, ®s))
- return;
- }
- }
- }
-
- /*
- * search for a font, returning its number if found and HASWIN_FALSE
- * if not found.
- */
- int haswin_findfont(char *name, int xsize, int ysize, int xscale, int yscale) {
- _kernel_swi_regs regs;
-
- if (!name)
- return(HASWIN_FALSE);
- regs.r[1] = (int)name;
- regs.r[2] = 16*xsize;
- regs.r[3] = 16*ysize;
- regs.r[4] = xscale;
- regs.r[5] = yscale;
- if (!haswin_swi(FONT_Find_font, ®s))
- return(HASWIN_FALSE);
- if ((regs.r[0] > 255) || (regs.r[0] < 0))
- return(HASWIN_FALSE);
- haswin_fontarray[regs.r[0] & 0xFF]++;
- return(regs.r[0] & 0xFF);
- }
-
-