~ubuntu-branches/ubuntu/precise/graphviz/precise-security

« back to all changes in this revision

Viewing changes to lib/glcomp/glTexFont.h

  • Committer: Bazaar Package Importer
  • Author(s): David Claughton
  • Date: 2010-03-24 22:45:18 UTC
  • mfrom: (1.2.7 upstream) (6.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100324224518-do441tthbqjaqjzd
Tags: 2.26.3-4
Add patch to fix segfault in circo. Backported from upstream snapshot
release.  Thanks to Francis Russell for his work on this.
(Closes: #575255)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Copyright (c) 1999 Nate Miller
3
 
    
4
 
    Notice: Usage of any code in this file is subject to the rules
5
 
    described in the LICENSE.TXT file included in this directory.
6
 
    Reading, compiling, or otherwise using this code constitutes
7
 
    automatic acceptance of the rules in said text file.
8
 
 
9
 
    File        -- glTexFont.h
10
 
    Date        -- 5/30/99
11
 
    Author      -- Nate 'm|d' Miller
12
 
    Contact     -- vandals1@home.com
13
 
    Web         -- http://members.home.com/vandals1
14
 
*/
15
 
#ifndef __GLTEXFONTH__
16
 
#define __GLTEXFONTH__
17
 
 
18
 
/* Error Codes */
19
 
#define FONT_FILE_NOT_FOUND          -13 /* file was not found */
20
 
#define FONT_BAD_IMAGE_TYPE          -14 /* color mapped image or image is not uncompressed */
21
 
#define FONT_BAD_DIMENSION           -15 /* dimension is not a power of 2 */
22
 
#define FONT_BAD_BITS                -16 /* image bits is not 8, 24 or 32 */
23
 
#define FONT_BAD_DATA                -17 /* image data could not be loaded */
24
 
#define GL_TEX_FONT_VERSION          6
25
 
 
26
 
#ifndef vec2_t
27
 
typedef float vec2_t[2];
28
 
#endif
29
 
 
30
 
typedef struct
31
 
{
32
 
    float fgColor[4];   /* foreground color, default white */
33
 
    float gdColor[4];   /* gradient color, default gray */
34
 
    float bgColor[4];   /* background color, default gray */
35
 
    int size;           /* size of text, default 12 */
36
 
    int shadow;         /* shadow text? default 0 */
37
 
    int gradient;       /* gradient? default 0 */
38
 
    int italic;         /* italic amount, defaul 0 */
39
 
    int bold;           /* bold text? */
40
 
    int region;         /* do we have a text region */
41
 
    int regionX;        /* lower left x */
42
 
    int regionY;        /* lower left y */
43
 
    int regionW;        /* text region w */
44
 
    int regionH;        /* text region h */
45
 
    float tIncX;        /* used for texture coords, x axis amount to move */
46
 
    float tIncY;        /* used for texture coords, y axis amount to move */
47
 
    int blockRow;       /* characters per row */
48
 
    int blockCol;       /* characters per col */
49
 
    unsigned int texId; /* texture id */
50
 
        float zdepth;   //third dimension , depth of fonts
51
 
} texFont_t;
52
 
 
53
 
#endif
54
 
#ifdef __cplusplus
55
 
extern "C" {
56
 
#endif
57
 
 
58
 
/*
59
 
=============
60
 
fontLoad
61
 
 
62
 
Loads up out font from the passed image file name.  
63
 
=============
64
 
*/
65
 
int fontLoad (char *name);
66
 
/*
67
 
=============
68
 
fontLoadEx
69
 
    
70
 
Same as above but it loads a custom font map with row chars per row and col
71
 
chars per column.  
72
 
=============
73
 
*/
74
 
int fontLoadEx (char *name, int row, int col);
75
 
/*
76
 
=============
77
 
fontDrawString
78
 
 
79
 
Draws a string at (xpos, ypos) in the applications window.
80
 
=============
81
 
*/
82
 
void fontDrawString (int xpos, int ypos, char *s,int width,...);
83
 
/*
84
 
=============
85
 
fontRegion
86
 
 
87
 
Sets up a font region.  Upper left corner is described by (xpos, ypos).
88
 
The region is w units wide and h units tall.  
89
 
=============
90
 
*/
91
 
void fontRegion (int xpos, int ypos, int w, int h);
92
 
/*
93
 
=============
94
 
fontSize 
95
 
 
96
 
Sets the font size.
97
 
=============
98
 
*/
99
 
void fontSize (int size);
100
 
 
101
 
 
102
 
void fontzdepth(float zdepth);
103
 
 
104
 
/*
105
 
=============
106
 
fontShadow
107
 
 
108
 
Draws shadowed text.
109
 
=============
110
 
*/
111
 
void fontShadow (void);
112
 
/*
113
 
=============
114
 
fontGradient
115
 
 
116
 
Draws gradient text. 
117
 
=============
118
 
*/
119
 
void fontGradient (void);
120
 
/*
121
 
=============
122
 
fontColor*, fontShadowColor*, fonrGradientColor*
123
 
 
124
 
Sets color for various operations. 
125
 
=============
126
 
*/
127
 
void fontColor (float r, float g, float b);
128
 
void fontColorA (float r, float g, float b, float a);
129
 
void fontColorp (float *clr);
130
 
void fontColorAp (float *clr);
131
 
void fontShadowColor (float r, float g, float b);
132
 
void fontShadowColorA (float r, float g, float b, float a);
133
 
void fontShadowColorp (float *clr);
134
 
void fontShadowColorAp (float *clr);
135
 
void fontGradientColor (float r, float g, float b);
136
 
void fontGradientColorA (float r, float g, float b, float a);
137
 
void fontGradientColorp (float *clr);
138
 
void fontGradientColorAp (float *clr);
139
 
#ifdef __cplusplus
140
 
}
141
 
#endif