87fdf40b4a83daa4311f858e4e159db4e2a37a26
[freeglut] / src / freeglut_glutfont_definitions.c
1 /*
2  * freeglut_glutfont_definitions.c
3  *
4  * Bitmap and stroke fonts displaying.
5  *
6  * Copyright (c) 2003 Stephen J. Baker (whether he wants it or not).
7  * All Rights Reserved.
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
11  *
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:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
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.
28  */
29
30 /*
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.
41  */
42
43 #include "freeglut_internal.h"
44
45 #if TARGET_HOST_UNIX_X11
46
47 struct freeglutStrokeFont
48 {
49   const char *name ; 
50   int num_chars ; 
51   void *ch ; 
52   float top ; 
53   float bottom ; 
54 }; 
55
56 struct freeglutBitmapFont
57
58   const char *name ; 
59   const int num_chars ; 
60   const int first ; 
61   const void *ch ; 
62 }; 
63
64
65 struct freeglutStrokeFont glutStrokeRoman ;
66 struct freeglutStrokeFont glutStrokeMonoRoman ;
67
68 struct freeglutBitmapFont glutBitmap9By15 ;
69 struct freeglutBitmapFont glutBitmap8By13 ;
70 struct freeglutBitmapFont glutBitmapTimesRoman10 ;
71 struct freeglutBitmapFont glutBitmapTimesRoman24 ;
72 struct freeglutBitmapFont glutBitmapHelvetica10 ;
73 struct freeglutBitmapFont glutBitmapHelvetica12 ;
74 struct freeglutBitmapFont glutBitmapHelvetica18 ;
75
76 #endif
77