NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvtexfont.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003 - 2012 NVIDIA Corporation. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  *
22  * This software is based upon texfont, with consent from Mark J. Kilgard,
23  * provided under the following terms:
24  *
25  * Copyright (c) Mark J. Kilgard, 1997.
26  *
27  * This program is freely distributable without licensing fees and is
28  * provided without guarantee or warrantee expressed or implied. This
29  * program is -not- in the public domain.
30  */
31 
32 #ifndef __NV_TEXFONT_H__
33 #define __NV_TEXFONT_H__
34 
35 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 //
67 // Public data types
68 //
69 
70 #define TXF_FORMAT_BYTE 0
71 #define TXF_FORMAT_BITMAP 1
72 
73 typedef void * NVTexfontContext;
74 
75 typedef enum {
79 
80 typedef enum {
84 
85 typedef struct _NVTexfontRasterFont NVTexfontRasterFont;
86 typedef struct _NVTexfontVectorFont NVTexfontVectorFont;
87 
88 //
89 // General functions
90 //
91 
92 extern char*
94 
99 extern NVTexfontContext
101 
105 extern void
107  NVTexfontContext tfc);
108 
116 extern void
118  NVTexfontContext tfc,
119  float x,
120  float y);
121 
129 extern void
131  NVTexfontContext tfc,
132  float scaleX,
133  float scaleY);
134 
135 extern void
137  NVTexfontContext tfc,
138  float r,
139  float g,
140  float b);
141 
142 // TODO: Raster and vector font structures/functions should be merged
143 // TODO: so that we initialize a font object as one or the other and
144 // TODO: then use the same set of top level functions for rendering.
145 
150 
151 extern int
153  NVTexfontRasterFont *txf,
154  int c);
169 extern NVTexfontRasterFont*
172  GLuint texobj,
173  GLboolean setupMipmaps,
174  GLenum minFilter,
175  GLenum magFilter);
176 
182 extern void
184  NVTexfontRasterFont *txf);
185 
207 extern void
209  NVTexfontRasterFont *txf,
210  char *string,
211  float x,
212  float y,
213  float scaleX,
214  float scaleY,
215  float r,
216  float g,
217  float b);
218 
229 extern void
231  NVTexfontRasterFont *txf,
232  NVTexfontContext tfc,
233  char *string,
234  float x,
235  float y);
236 
237 extern void
239  NVTexfontRasterFont *txf,
240  NVTexfontContext tfc,
241  char *string);
242 
243 extern void
245  NVTexfontRasterFont *txf,
246  char *string,
247  int len,
248  int *width,
249  int *max_ascent,
250  int *max_descent);
251 
257 
258 extern int
260  NVTexfontVectorFont *vtf,
261  int c);
262 
275 extern NVTexfontVectorFont*
278  GLboolean antialias,
279  GLboolean use_vbo);
280 
286 extern void
288  NVTexfontVectorFont *vtf);
289 
307 extern void
309  NVTexfontVectorFont *vtf,
310  char *string,
311  float x,
312  float y,
313  float scaleX,
314  float scaleY,
315  float r,
316  float g,
317  float b);
318 
329 extern void
331  NVTexfontVectorFont *vtf,
332  NVTexfontContext tfc,
333  char *string,
334  float x,
335  float y);
336 
345 extern void
347  NVTexfontVectorFont *vtf,
348  NVTexfontContext tfc,
349  char *string);
350 
353 #ifdef __cplusplus
354 }
355 #endif
356 
358 #endif /* __NV_TEXFONT_H__ */
359 
void nvtexfontSetContextPos(NVTexfontContext tfc, float x, float y)
Sets the x,y attributes for the NVTexfont context tfc.
NVTexfontContext nvtexfontAllocContext(void)
Allocates a handle for an NVTexfont context.
int uint32_t width
NVTexfontVectorFont * nvtexfontInitVectorFont(NVTexfontVectorFontName font, GLboolean antialias, GLboolean use_vbo)
Initialize an NVTexfontVectorFont.
void nvtexfontFreeContext(NVTexfontContext tfc)
Frees the specified NVTexfont context handle.
struct _NVTexfontRasterFont NVTexfontRasterFont
Definition: nvtexfont.h:85
NVTexfontVectorFontName
Definition: nvtexfont.h:80
void nvtexfontRenderVecString_All(NVTexfontVectorFont *vtf, char *string, float x, float y, float scaleX, float scaleY, float r, float g, float b)
Renders the specified null-terminated string by using the NVTexfontVectorFont vtf.
NVTexfontRasterFontName
Definition: nvtexfont.h:75
void nvtexfontSetContextColor(NVTexfontContext tfc, float r, float g, float b)
void nvtexfontSetContextScale(NVTexfontContext tfc, float scaleX, float scaleY)
Sets the x,y attributes for the NVTexfont context tfc.
NVTexfontRasterFont * nvtexfontInitRasterFont(NVTexfontRasterFontName font, GLuint texobj, GLboolean setupMipmaps, GLenum minFilter, GLenum magFilter)
Initializes an NVTexfontRasterFont.
void nvtexfontUnloadRasterFont(NVTexfontRasterFont *txf)
Frees textures used by the font txf.
struct _NVTexfontVectorFont NVTexfontVectorFont
Definition: nvtexfont.h:86
void nvtexfontRenderVecString(NVTexfontVectorFont *vtf, NVTexfontContext tfc, char *string)
Renders the specified null-terminated string as above but uses the position/scale/color from the NVTe...
void nvtexfontRenderVecString_Pos(NVTexfontVectorFont *vtf, NVTexfontContext tfc, char *string, float x, float y)
Renders the specified null-terminated string as above but uses the position/scale/color from the NVTe...
void nvtexfontRenderString_Pos(NVTexfontRasterFont *txf, NVTexfontContext tfc, char *string, float x, float y)
Renders the specified null-terminated string as above but uses the position/scale/color from the NVTe...
int nvtexfontInRasterFont(NVTexfontRasterFont *txf, int c)
void nvtexfontRenderString_All(NVTexfontRasterFont *txf, char *string, float x, float y, float scaleX, float scaleY, float r, float g, float b)
Renders the specified null-terminated string by using the NVTexfont txf.
int nvtexfontInVectorFont(NVTexfontVectorFont *vtf, int c)
void * NVTexfontContext
Definition: nvtexfont.h:73
void nvtexfontRenderString(NVTexfontRasterFont *txf, NVTexfontContext tfc, char *string)
void nvtexfontGetStringMetrics(NVTexfontRasterFont *txf, char *string, int len, int *width, int *max_ascent, int *max_descent)
void nvtexfontUnloadVectorFont(NVTexfontVectorFont *vtf)
Frees resources used by the vector font vtf, including the VBO if used.
char * nvtexfontErrorString(void)