15 #ifndef TEXTPROPERTIES_H
16 #define TEXTPROPERTIES_H
18 #include "pandabase.h"
20 #include "config_text.h"
23 #include "pointerTo.h"
65 INLINE
bool is_any_specified()
const;
67 INLINE
static void set_default_font(
TextFont *);
68 INLINE
static TextFont *get_default_font();
70 INLINE
void set_font(
TextFont *font);
71 INLINE
void clear_font();
72 INLINE
bool has_font()
const;
75 INLINE
void set_small_caps(
bool small_caps);
76 INLINE
void clear_small_caps();
77 INLINE
bool has_small_caps()
const;
78 INLINE
bool get_small_caps()
const;
80 INLINE
void set_small_caps_scale(PN_stdfloat small_caps_scale);
81 INLINE
void clear_small_caps_scale();
82 INLINE
bool has_small_caps_scale()
const;
83 INLINE PN_stdfloat get_small_caps_scale()
const;
85 INLINE
void set_slant(PN_stdfloat slant);
86 INLINE
void clear_slant();
87 INLINE
bool has_slant()
const;
88 INLINE PN_stdfloat get_slant()
const;
90 INLINE
void set_underscore(
bool underscore);
91 INLINE
void clear_underscore();
92 INLINE
bool has_underscore()
const;
93 INLINE
bool get_underscore()
const;
95 INLINE
void set_underscore_height(PN_stdfloat underscore_height);
96 INLINE
void clear_underscore_height();
97 INLINE
bool has_underscore_height()
const;
98 INLINE PN_stdfloat get_underscore_height()
const;
100 INLINE
void set_align(Alignment align_type);
101 INLINE
void clear_align();
102 INLINE
bool has_align()
const;
103 INLINE Alignment get_align()
const;
105 INLINE
void set_indent(PN_stdfloat indent);
106 INLINE
void clear_indent();
107 INLINE
bool has_indent()
const;
108 INLINE PN_stdfloat get_indent()
const;
110 INLINE
void set_wordwrap(PN_stdfloat wordwrap);
111 INLINE
void clear_wordwrap();
112 INLINE
bool has_wordwrap()
const;
113 INLINE PN_stdfloat get_wordwrap()
const;
115 INLINE
void set_preserve_trailing_whitespace(
bool preserve_trailing_whitespace);
116 INLINE
void clear_preserve_trailing_whitespace();
117 INLINE
bool has_preserve_trailing_whitespace()
const;
118 INLINE
bool get_preserve_trailing_whitespace()
const;
120 INLINE
void set_text_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a);
121 INLINE
void set_text_color(
const LColor &text_color);
122 INLINE
void clear_text_color();
123 INLINE
bool has_text_color()
const;
124 INLINE
LColor get_text_color()
const;
126 INLINE
void set_shadow_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a);
127 INLINE
void set_shadow_color(
const LColor &shadow_color);
128 INLINE
void clear_shadow_color();
129 INLINE
bool has_shadow_color()
const;
130 INLINE
LColor get_shadow_color()
const;
132 INLINE
void set_shadow(PN_stdfloat xoffset, PN_stdfloat yoffset);
133 INLINE
void set_shadow(
const LVecBase2 &shadow_offset);
134 INLINE
void clear_shadow();
135 INLINE
bool has_shadow()
const;
138 INLINE
void set_bin(
const string &bin);
139 INLINE
void clear_bin();
140 INLINE
bool has_bin()
const;
141 INLINE
const string &get_bin()
const;
143 INLINE
int set_draw_order(
int draw_order);
144 INLINE
void clear_draw_order();
145 INLINE
bool has_draw_order()
const;
146 INLINE
int get_draw_order()
const;
148 INLINE
void set_tab_width(PN_stdfloat tab_width);
149 INLINE
void clear_tab_width();
150 INLINE
bool has_tab_width()
const;
151 INLINE PN_stdfloat get_tab_width()
const;
153 INLINE
void set_glyph_scale(PN_stdfloat glyph_scale);
154 INLINE
void clear_glyph_scale();
155 INLINE
bool has_glyph_scale()
const;
156 INLINE PN_stdfloat get_glyph_scale()
const;
158 INLINE
void set_glyph_shift(PN_stdfloat glyph_shift);
159 INLINE
void clear_glyph_shift();
160 INLINE
bool has_glyph_shift()
const;
161 INLINE PN_stdfloat get_glyph_shift()
const;
163 INLINE
void set_text_scale(PN_stdfloat text_scale);
164 INLINE
void clear_text_scale();
165 INLINE
bool has_text_scale()
const;
166 INLINE PN_stdfloat get_text_scale()
const;
170 void write(ostream &out,
int indent_level = 0)
const;
173 static void load_default_font();
176 F_has_font = 0x00000001,
177 F_has_small_caps = 0x00000002,
178 F_has_small_caps_scale = 0x00000004,
179 F_has_slant = 0x00000008,
180 F_has_align = 0x00000010,
181 F_has_indent = 0x00000020,
182 F_has_wordwrap = 0x00000040,
183 F_has_preserve_trailing_whitespace = 0x00000080,
184 F_has_text_color = 0x00000100,
185 F_has_shadow_color = 0x00000200,
186 F_has_shadow = 0x00000400,
187 F_has_bin = 0x00000800,
188 F_has_draw_order = 0x00001000,
189 F_has_tab_width = 0x00002000,
190 F_has_glyph_scale = 0x00004000,
191 F_has_glyph_shift = 0x00008000,
192 F_has_underscore = 0x00010000,
193 F_has_underscore_height = 0x00020000,
194 F_has_text_scale = 0x00040000,
201 PN_stdfloat _small_caps_scale;
204 PN_stdfloat _underscore_height;
206 PN_stdfloat _indent_width;
207 PN_stdfloat _wordwrap_width;
208 bool _preserve_trailing_whitespace;
214 PN_stdfloat _tab_width;
215 PN_stdfloat _glyph_scale;
216 PN_stdfloat _glyph_shift;
217 PN_stdfloat _text_scale;
220 static bool _loaded_default_font;
226 static void init_type() {
227 register_type(_type_handle,
"TextProperties");
234 #include "textProperties.I"
An encapsulation of a font; i.e.
This is the base class for all two-component vectors and points.
This is the base class for all three-component vectors and points.
This is a two-component vector offset.
This defines the set of visual properties that may be assigned to the individual characters of the te...
TypeHandle is the identifier used to differentiate C++ class types.