1 /**************************************************************************
2 ** (c) Copyright 1998, Andromeda Technology & Automation
3 ***************************************************************************
4 ** MODULE INFORMATION *
5 ***********************
7 ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
8 ** VERSION NUMBER : $Revision: 1.1 $
10 ** DESCRIPTION : Definition of font class
12 ** EXPORTED OBJECTS : class font
15 ***************************************************************************
16 ** ADMINISTRATIVE INFORMATION *
17 ********************************
18 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
19 ** CREATION DATE : Feb 13, 1998
20 ** LAST UPDATE : Jan 22, 2002
22 **************************************************************************/
24 /*****************************
26 Revision 1.1 2002-07-25 08:01:26 arjen
27 First checkin, AXE release 0.2
29 *****************************/
31 /* static const char *RCSID = "$Id: font.h,v 1.1 2002-07-25 08:01:26 arjen Exp $"; */
39 ///////////////////////////////////////////////////////////////////////////
42 // MEMBERS : XFontStruct *fs
50 // LAST MODIFIED : Jan 22, 2002
51 ///////////////////////////////////////////////////////////////////////////
67 fs = XLoadQueryFont(stddpy.Dpy(), name);
70 cerr << "Warnig: can not open font " << name << "\n";
77 XFreeFont(stddpy.Dpy(), fs);
88 XFreeFont(stddpy.Dpy(), fs);
89 fs = XLoadQueryFont(stddpy.Dpy(), name);
92 cerr << "Warnig: can not open font " << name << "\n";
98 return fs ? fs->fid : 0;
101 int TextWidth(char *string, int length = 0);
102 int TextWidth(const String & string);
106 return fs ? fs->ascent : 0;
111 return fs ? fs->descent : 0;