Panda3D
 All Classes Functions Variables Enumerations
config_pnmtext.cxx
1 // Filename: config_pnmtext.cxx
2 // Created by: drose (08Sep03)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_pnmtext.h"
16 
17 #include "dconfig.h"
18 #include "freetypeFace.h"
19 
20 Configure(config_pnmtext);
21 NotifyCategoryDef(pnmtext, "");
22 
23 ConfigureFn(config_pnmtext) {
24  init_libpnmtext();
25 }
26 
27 ConfigVariableDouble text_point_size
28 ("text-point-size", 10.0);
29 ConfigVariableDouble text_pixels_per_unit
30 ("text-pixels-per-unit", 40.0);
31 ConfigVariableDouble text_scale_factor
32 ("text-scale-factor", 2.0);
33 ConfigVariableBool text_native_antialias
34 ("text-native-antialias", true);
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: init_libpnmtext
38 // Description: Initializes the library. This must be called at
39 // least once before any of the functions or classes in
40 // this library can be used. Normally it will be
41 // called by the static initializers and need not be
42 // called explicitly, but special cases exist.
43 ////////////////////////////////////////////////////////////////////
44 void
45 init_libpnmtext() {
46  static bool initialized = false;
47  if (initialized) {
48  return;
49  }
50  initialized = true;
51 
52  FreetypeFace::init_type();
53 }
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a floating-point type.