Panda3D
default_font.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file default_font.cxx
10  * @author drose
11  * @date 2003-01-31
12  */
13 
14 #include "default_font.h"
15 
16 // The binary data included here was generated from an existing font file via
17 // the utility program bin2c (defined in pandatool). It is used as the
18 // default font when no font file is specified by the user.
19 
20 // The particular font we use may come from either of two possible sources:
21 
22 /*
23  * If we have the Freetype library available, we use persans.ttf, part of the
24  * "Perspective Sans" font family downloaded from http:www.fontsquirrel
25  * .comfontsPerspective-Sans, which appears to be freeware. If Freetype is
26  * not available, we use cmss12.bam, which was in turn generated from
27  * cmss12.720pk, and defines "Computer Modern Sans Serif", a basic Metafont-
28  * generated font supplied with TeX. This egg file, by the way, is also
29  * distributed with Panda in the models tree.
30  */
31 
32 #if defined(COMPILE_IN_DEFAULT_FONT) && !defined(CPPPARSER)
33 
34 #ifdef HAVE_FREETYPE
35 
36 // If we have FreeType available, include the ttf font; it's superior because
37 // it's dynamic. See above.
38 #include "persans.ttf_src.c"
39 
40 #elif defined(HAVE_ZLIB)
41 
42 // If we don't have FreeType, we have to include the bam font, which is kind
43 // of bulky but at least we can compress it if we have zlib.
44 
45 // Regenerate this file with (cmss12.egg can be loaded from the models tree):
46 
47 // egg2bam -rawtex -o cmss12.bam cmss12.egg pzip cmss12.bam bin2c -n
48 // default_font_data -o cmss12.bam.pz_src.c cmss12.bam.pz
49 
50 #include "cmss12.bam.pz_src.c"
51 
52 #else
53 
54 // If we don't even have zlib, just include the whole uncompressed bam file.
55 
56 // Regenerate this file with (cmss12.egg can be loaded from the models tree):
57 
58 // egg2bam -rawtex -o cmss12.bam cmss12.egg bin2c -n default_font_data -o
59 // cmss12.bam_src.c cmss12.bam
60 
61 #include "cmss12.bam_src.c"
62 
63 #endif
64 
65 const int default_font_size = sizeof(default_font_data);
66 
67 #endif // COMPILE_IN_DEFAULT_FONT && !CPPPARSER
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.