00001 // Filename: default_font.cxx 00002 // Created by: drose (31Jan03) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "default_font.h" 00016 00017 // The binary data included here was generated from an existing font 00018 // file via the utility program bin2c (defined in pandatool). It is 00019 // used as the default font when no font file is specified by the 00020 // user. 00021 00022 // The particular font we use may come from either of two possible 00023 // sources: 00024 00025 // If we have the Freetype library available, we use persans.ttf, part 00026 // of the "Perspective Sans" font family downloaded from 00027 // http://www.fontsquirrel.com/fonts/Perspective-Sans, which appears 00028 // to be freeware. 00029 // 00030 // If Freetype is not available, we use cmss12.bam, which was in turn 00031 // generated from cmss12.720pk, and defines "Computer Modern Sans 00032 // Serif", a basic Metafont-generated font supplied with TeX. This 00033 // egg file, by the way, is also distributed with Panda in the models 00034 // tree. 00035 00036 #if defined(COMPILE_IN_DEFAULT_FONT) && !defined(CPPPARSER) 00037 00038 #ifdef HAVE_FREETYPE 00039 00040 // If we have FreeType available, include the ttf font; it's superior 00041 // because it's dynamic. See above. 00042 #include "persans.ttf_src.c" 00043 00044 #elif defined(HAVE_ZLIB) 00045 00046 // If we don't have FreeType, we have to include the bam font, which 00047 // is kind of bulky but at least we can compress it if we have zlib. 00048 00049 // Regenerate this file with (cmss12.egg can be loaded from the models tree): 00050 00051 // egg2bam -rawtex -o cmss12.bam cmss12.egg 00052 // pzip cmss12.bam 00053 // bin2c -n default_font_data -o cmss12.bam.pz_src.c cmss12.bam.pz 00054 00055 #include "cmss12.bam.pz_src.c" 00056 00057 #else 00058 00059 // If we don't even have zlib, just include the whole uncompressed bam 00060 // file. 00061 00062 // Regenerate this file with (cmss12.egg can be loaded from the models tree): 00063 00064 // egg2bam -rawtex -o cmss12.bam cmss12.egg 00065 // bin2c -n default_font_data -o cmss12.bam_src.c cmss12.bam 00066 00067 #include "cmss12.bam_src.c" 00068 00069 #endif 00070 00071 const int default_font_size = sizeof(default_font_data); 00072 00073 #endif // COMPILE_IN_DEFAULT_FONT && !CPPPARSER