First checkin, AXE release 0.2
[AXE.git] / src / font.cpp
1 /**************************************************************************
2 **  (c) Copyright 1998, Andromeda Technology & Automation
3 ***************************************************************************
4 ** MODULE INFORMATION *
5 ***********************
6 **      FILE NAME      : font.cpp
7 **      SYSTEM NAME    : AXE - Andromeda X-windows Encapsulation
8 **      VERSION NUMBER : $Revision: 1.1 $
9 **
10 **  DESCRIPTION      :  Implementation of font class
11 **
12 **  EXPORTED OBJECTS : font::TextWidth()
13 **  LOCAL    OBJECTS : 
14 **  MODULES  USED    :
15 ***************************************************************************
16 **  ADMINISTRATIVE INFORMATION *
17 ********************************
18 **      ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
19 **      CREATION DATE   : Feb 13, 1998
20 **      LAST UPDATE     : Feb 13, 1998
21 **      MODIFICATIONS   : 
22 **************************************************************************/
23
24 /*****************************
25    $Log: font.cpp,v $
26    Revision 1.1  2002-07-25 08:01:26  arjen
27    First checkin, AXE release 0.2
28
29 *****************************/
30
31 static const char *RCSID = "$Id: font.cpp,v 1.1 2002-07-25 08:01:26 arjen Exp $";
32
33 #include <string.h>
34 #include "font.h"
35
36 int font::TextWidth(char *string, int length = 0)
37 {
38    if (length == 0)
39    {
40       length = strlen(string);
41    }
42
43    return XTextWidth(fs, string, length);
44 }
45
46 int font::TextWidth(const String & string)
47 {
48    return XTextWidth(fs, string, ~string);
49 }