convert line ends
[canaan.git] / prj / tech / libsrc / font / strclr.c
blob12c2f3a2bdb6ce6be2c48f671de1641020648cc1
1 /*
2 * $Source: s:/prj/tech/libsrc/font/RCS/strclr.c $
3 * $Revision: 1.1 $
4 * $Author: KEVIN $
5 * $Date: 1996/04/11 10:25:29 $
7 * Clipped string clear routine.
9 * This file is part of the font library.
13 #include <strsiz.h>
14 #include <dev2d.h>
16 /* clear a string to the background color, with clipping. */
18 int gr_font_string_clear (grs_font *f, char *s, short x, short y)
20 short w, h; /* extent of string */
21 long c; /* saved foreground color */
22 int r; /* return clip code */
24 c = gr_get_fcolor();
25 gr_set_fcolor (gr_get_bcolor ());
26 gr_font_string_size (f, s, &w, &h);
27 r = gr_rect (x, y, x+w, y+h);
28 gr_set_fcolor (c);
29 return r;
32 /* clear a string to the background color, unclipped. */
34 void gr_font_string_uclear (grs_font *f, char *s, short x, short y)
36 short w, h; /* extent of string */
37 long c; /* saved foreground color */
39 c = gr_get_fcolor();
40 gr_set_fcolor (gr_get_bcolor());
41 gr_font_string_size (f, s, &w, &h);
42 gr_urect (x, y, x+w, y+h);
43 gr_set_fcolor (c);