2 * freeglut_glutfont_definitions.c
4 * Bitmap and stroke fonts displaying.
6 * Copyright (c) 2003 Stephen J. Baker (whether he wants it or not).
8 * Written by John F. Fay <fayjf@sourceforge.net>, who releases the
9 * copyright over to the "freeglut" project lead.
10 * Creation date: Mon July 21 2003
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
26 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 * This file is necessary for the *nix version of "freeglut" because the
32 * original GLUT defined its font variables in rather an unusual way.
33 * Publicly, in "glut.h", they were defined as "void *". Privately,
34 * in one of the source code files, they were defined as pointers to a
35 * structure. Most compilers and linkers are satisfied with the "void *"
36 * and don't go any farther, but some of them balked. In particular,
37 * when compiling with "freeglut" and then trying to run using the GLUT
38 * ".so" library, some of them would give an error. So we are having to
39 * create this file to define the variables as pointers to an unusual
40 * structure to match GLUT.
44 * freeglut_internal.h uses some GL types, but including the GL header portably
45 * is a bit tricky, so we include freeglut_std.h here, which contains the
46 * necessary machinery. But this poses another problem, caused by the ugly
47 * original defintion of the font constants in "classic" GLUT: They are defined
48 * as void* externally, so we move them temporarily out of the way by AN EXTREME
52 #define glutStrokeRoman glutStrokeRomanIGNOREME
53 #define glutStrokeMonoRoman glutStrokeMonoRomanIGNOREME
54 #define glutBitmap9By15 glutBitmap9By15IGNOREME
55 #define glutBitmap8By13 glutBitmap8By13IGNOREME
56 #define glutBitmapTimesRoman10 glutBitmapTimesRoman10IGNOREME
57 #define glutBitmapTimesRoman24 glutBitmapTimesRoman24IGNOREME
58 #define glutBitmapHelvetica10 glutBitmapHelvetica10IGNOREME
59 #define glutBitmapHelvetica12 glutBitmapHelvetica12IGNOREME
60 #define glutBitmapHelvetica18 glutBitmapHelvetica18IGNOREME
62 #include <GL/freeglut_std.h>
64 #undef glutStrokeRoman
65 #undef glutStrokeMonoRoman
66 #undef glutBitmap9By15
67 #undef glutBitmap8By13
68 #undef glutBitmapTimesRoman10
69 #undef glutBitmapTimesRoman24
70 #undef glutBitmapHelvetica10
71 #undef glutBitmapHelvetica12
72 #undef glutBitmapHelvetica18
74 #include "freeglut_internal.h"
76 #if TARGET_HOST_POSIX_X11
78 struct freeglutStrokeFont
87 struct freeglutBitmapFont
96 struct freeglutStrokeFont glutStrokeRoman ;
97 struct freeglutStrokeFont glutStrokeMonoRoman ;
99 struct freeglutBitmapFont glutBitmap9By15 ;
100 struct freeglutBitmapFont glutBitmap8By13 ;
101 struct freeglutBitmapFont glutBitmapTimesRoman10 ;
102 struct freeglutBitmapFont glutBitmapTimesRoman24 ;
103 struct freeglutBitmapFont glutBitmapHelvetica10 ;
104 struct freeglutBitmapFont glutBitmapHelvetica12 ;
105 struct freeglutBitmapFont glutBitmapHelvetica18 ;