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.2 $
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.2 2002-11-04 07:24:31 arjen
27 Use proper namespace for iostream classes
29 Revision 1.1 2002/07/25 08:01:26 arjen
30 First checkin, AXE release 0.2
32 *****************************/
34 /* static const char *RCSID = "$Id: font.h,v 1.2 2002-11-04 07:24:31 arjen Exp $"; */
42 ///////////////////////////////////////////////////////////////////////////
45 // MEMBERS : XFontStruct *fs
53 // LAST MODIFIED : Jan 22, 2002
54 ///////////////////////////////////////////////////////////////////////////
68 font(const char name[])
70 fs = XLoadQueryFont(stddpy.Dpy(), name);
73 std::cerr << "Warnig: can not open font " << name << "\n";
80 XFreeFont(stddpy.Dpy(), fs);
88 void Load(const char name[])
91 XFreeFont(stddpy.Dpy(), fs);
92 fs = XLoadQueryFont(stddpy.Dpy(), name);
95 std::cerr << "Warnig: can not open font " << name << "\n";
101 return fs ? fs->fid : 0;
104 int TextWidth(char *string, int length = 0);
105 int TextWidth(const String & string);
109 return fs ? fs->ascent : 0;
114 return fs ? fs->descent : 0;