~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to ddd/FontTable.C

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: FontTable.C,v 1.11 1999/08/19 11:27:28 andreas Exp $
 
1
// $Id$
2
2
// Font tables
3
3
 
4
4
// Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
27
27
// or send a mail to the DDD developers <ddd@gnu.org>.
28
28
 
29
29
char FontTable_rcsid[] = 
30
 
    "$Id: FontTable.C,v 1.11 1999/08/19 11:27:28 andreas Exp $";
31
 
 
32
 
#ifdef __GNUG__
33
 
#pragma implementation
34
 
#endif
35
 
 
 
30
    "$Id$";
36
31
 
37
32
#include "assert.h"
38
33
#include "hash.h"
39
34
#include "strclass.h"
40
35
 
41
 
#include <iostream.h>
 
36
#include <iostream>
42
37
#include <X11/Xlib.h>
43
38
#include <X11/Intrinsic.h>
44
39
 
55
50
}
56
51
 
57
52
// Return XFontStruct for given font name NAME
58
 
XFontStruct *FontTable::operator[](string& name)
 
53
XFontStruct *FontTable::operator[](const string& name)
59
54
{
60
55
    int i = hash(name.chars());
61
56
    while (table[i].font != 0 && name != table[i].name)
72
67
 
73
68
        if (table[i].font == 0)
74
69
        {
75
 
            cerr << "Warning: Could not load font \"" << name << "\"";
 
70
            std::cerr << "Warning: Could not load font \"" << name << "\"";
76
71
 
77
72
            // Try default font
78
73
            GC default_gc = 
84
79
                XFontStruct *font = XQueryFont(_display, font_id);
85
80
                if (font != 0)
86
81
                {
87
 
                    cerr << ", using default font instead\n";
 
82
                    std::cerr << ", using default font instead\n";
88
83
                    table[i].font = font;
89
84
                }
90
85
            }
96
91
            XFontStruct *font = XLoadQueryFont(_display, "fixed");
97
92
            if (font != 0)
98
93
            {
99
 
                cerr << ", using font \"fixed\" instead\n";
 
94
                std::cerr << ", using font \"fixed\" instead\n";
100
95
                table[i].font = font;
101
96
            }
102
97
        }
103
98
 
104
99
        if (table[i].font == 0)
105
 
            cerr << "\n";
 
100
            std::cerr << "\n";
106
101
    }
107
102
 
108
103
    return table[i].font;