1 /**
2 ** drawtext.c ---- draw a character string with the default font
3 **
4 ** Copyright (c) 1995 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
5 ** [e-mail: csaba@vuse.vanderbilt.edu]
6 **
7 ** This file is part of the GRX graphics library.
8 **
9 ** The GRX graphics library is free software; you can redistribute it
10 ** and/or modify it under some conditions; see the "copying.grx" file
11 ** for details.
12 **
13 ** This library is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 **
17 **/
18
19 #include <string.h>
20 #include "libgrx.h"
21
GrTextXY(int x,int y,char * text,GrColor fg,GrColor bg)22 void GrTextXY(int x,int y,char *text,GrColor fg,GrColor bg)
23 {
24 GrTextOption opt;
25 opt.txo_font = &GrDefaultFont;
26 opt.txo_fgcolor.v = fg;
27 opt.txo_bgcolor.v = bg;
28 opt.txo_chrtype = GR_BYTE_TEXT;
29 opt.txo_direct = GR_TEXT_RIGHT;
30 opt.txo_xalign = GR_ALIGN_LEFT;
31 opt.txo_yalign = GR_ALIGN_TOP;
32 GrDrawString(text,(int)strlen(text),x,y,&opt);
33 }
34
35