17 INLINE
bool TextProperties::
19 return !operator == (other);
27 return (_specified != 0);
38 _loaded_default_font =
true;
48 if (!_loaded_default_font) {
61 _specified |= F_has_font;
67 INLINE
void TextProperties::
70 _specified &= ~F_has_font;
76 INLINE
bool TextProperties::
78 return (_specified & F_has_font) != 0;
106 _small_caps = small_caps;
107 _specified |= F_has_small_caps;
113 INLINE
void TextProperties::
116 _specified &= ~F_has_small_caps;
122 INLINE
bool TextProperties::
123 has_small_caps()
const {
124 return (_specified & F_has_small_caps) != 0;
130 INLINE
bool TextProperties::
131 get_small_caps()
const {
142 _small_caps_scale = small_caps_scale;
148 INLINE
void TextProperties::
149 clear_small_caps_scale() {
150 _small_caps_scale = text_small_caps_scale;
151 _specified &= ~F_has_small_caps_scale;
157 INLINE
bool TextProperties::
158 has_small_caps_scale()
const {
159 return (_specified & F_has_small_caps_scale) != 0;
167 INLINE PN_stdfloat TextProperties::
168 get_small_caps_scale()
const {
169 return _small_caps_scale;
178 _specified |= F_has_slant;
184 INLINE
void TextProperties::
187 _specified &= ~F_has_slant;
193 INLINE
bool TextProperties::
195 return (_specified & F_has_slant) != 0;
201 INLINE PN_stdfloat TextProperties::
213 _underscore = underscore;
214 _specified |= F_has_underscore;
220 INLINE
void TextProperties::
223 _specified &= ~F_has_underscore;
229 INLINE
bool TextProperties::
230 has_underscore()
const {
231 return (_specified & F_has_underscore) != 0;
237 INLINE
bool TextProperties::
238 get_underscore()
const {
249 _underscore_height = underscore_height;
250 _specified |= F_has_underscore_height;
256 INLINE
void TextProperties::
257 clear_underscore_height() {
258 _underscore_height = 0.0f;
259 _specified &= ~F_has_underscore_height;
265 INLINE
bool TextProperties::
266 has_underscore_height()
const {
267 return (_specified & F_has_underscore_height) != 0;
273 INLINE PN_stdfloat TextProperties::
274 get_underscore_height()
const {
275 return has_underscore_height() ? _underscore_height : text_default_underscore_height;
282 set_align(TextProperties::Alignment align_type) {
284 _specified |= F_has_align;
290 INLINE
void TextProperties::
293 _specified &= ~F_has_align;
299 INLINE
bool TextProperties::
301 return (_specified & F_has_align) != 0;
307 INLINE TextProperties::Alignment TextProperties::
319 _specified |= F_has_indent;
325 INLINE
void TextProperties::
327 _indent_width = 0.0f;
328 _specified &= ~F_has_indent;
334 INLINE
bool TextProperties::
336 return (_specified & F_has_indent) != 0;
342 INLINE PN_stdfloat TextProperties::
344 return _indent_width;
353 _wordwrap_width = wordwrap;
354 _specified |= F_has_wordwrap;
360 INLINE
void TextProperties::
362 _wordwrap_width = 0.0f;
363 _specified &= ~F_has_wordwrap;
369 INLINE
bool TextProperties::
370 has_wordwrap()
const {
371 return (_specified & F_has_wordwrap) != 0;
377 INLINE PN_stdfloat TextProperties::
378 get_wordwrap()
const {
379 return _wordwrap_width;
391 _preserve_trailing_whitespace = preserve_trailing_whitespace;
392 _specified |= F_has_preserve_trailing_whitespace;
398 INLINE
void TextProperties::
399 clear_preserve_trailing_whitespace() {
400 _preserve_trailing_whitespace =
false;
401 _specified &= ~F_has_preserve_trailing_whitespace;
407 INLINE
bool TextProperties::
408 has_preserve_trailing_whitespace()
const {
409 return (_specified & F_has_preserve_trailing_whitespace) != 0;
416 INLINE
bool TextProperties::
417 get_preserve_trailing_whitespace()
const {
418 return _preserve_trailing_whitespace;
424 INLINE
void TextProperties::
425 set_text_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
426 set_text_color(LColor(r, g, b, a));
432 INLINE
void TextProperties::
433 set_text_color(
const LColor &text_color) {
434 _text_color = text_color;
435 _specified |= F_has_text_color;
443 INLINE
void TextProperties::
445 _text_color.set(1.0f, 1.0f, 1.0f, 1.0f);
446 _specified &= ~F_has_text_color;
453 INLINE
bool TextProperties::
454 has_text_color()
const {
455 return (_specified & F_has_text_color) != 0;
461 INLINE LColor TextProperties::
462 get_text_color()
const {
469 INLINE
void TextProperties::
470 set_shadow_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
471 set_shadow_color(LColor(r, g, b, a));
477 INLINE
void TextProperties::
478 set_shadow_color(
const LColor &shadow_color) {
479 _shadow_color = shadow_color;
480 _specified |= F_has_shadow_color;
481 _shadow_state.clear();
487 INLINE
void TextProperties::
488 clear_shadow_color() {
489 _shadow_color.set(0.0f, 0.0f, 0.0f, 1.0f);
490 _specified &= ~F_has_shadow_color;
491 _shadow_state.clear();
497 INLINE
bool TextProperties::
498 has_shadow_color()
const {
499 return (_specified & F_has_shadow_color) != 0;
505 INLINE LColor TextProperties::
506 get_shadow_color()
const {
507 return _shadow_color;
515 set_shadow(PN_stdfloat xoffset, PN_stdfloat yoffset) {
525 _shadow_offset = shadow_offset;
526 _specified |= F_has_shadow;
532 INLINE
void TextProperties::
534 _specified &= ~F_has_shadow;
535 _shadow_offset.set(0.0f, 0.0f);
541 INLINE
bool TextProperties::
543 return (_specified & F_has_shadow) != 0;
550 INLINE LVector2 TextProperties::
552 return _shadow_offset;
565 set_bin(
const std::string &bin) {
567 _specified |= F_has_bin;
569 _shadow_state.clear();
576 INLINE
void TextProperties::
578 _bin = std::string();
579 _specified &= ~F_has_bin;
581 _shadow_state.clear();
588 INLINE
bool TextProperties::
590 return (_specified & F_has_bin) != 0;
597 INLINE
const std::string &TextProperties::
615 _draw_order = draw_order;
616 _specified |= F_has_draw_order;
618 _shadow_state.clear();
619 return _draw_order + 3;
625 INLINE
void TextProperties::
628 _specified &= ~F_has_draw_order;
630 _shadow_state.clear();
636 INLINE
bool TextProperties::
637 has_draw_order()
const {
638 return (_specified & F_has_draw_order) != 0;
644 INLINE
int TextProperties::
645 get_draw_order()
const {
655 _tab_width = tab_width;
656 _specified |= F_has_tab_width;
662 INLINE
void TextProperties::
664 _tab_width = text_tab_width;
665 _specified &= ~F_has_tab_width;
671 INLINE
bool TextProperties::
672 has_tab_width()
const {
673 return (_specified & F_has_tab_width) != 0;
679 INLINE PN_stdfloat TextProperties::
680 get_tab_width()
const {
697 _glyph_scale = glyph_scale;
698 _specified |= F_has_glyph_scale;
704 INLINE
void TextProperties::
705 clear_glyph_scale() {
706 _specified &= ~F_has_glyph_scale;
713 INLINE
bool TextProperties::
714 has_glyph_scale()
const {
715 return (_specified & F_has_glyph_scale) != 0;
721 INLINE PN_stdfloat TextProperties::
722 get_glyph_scale()
const {
733 _glyph_shift = glyph_shift;
734 _specified |= F_has_glyph_shift;
740 INLINE
void TextProperties::
741 clear_glyph_shift() {
742 _specified &= ~F_has_glyph_shift;
749 INLINE
bool TextProperties::
750 has_glyph_shift()
const {
751 return (_specified & F_has_glyph_shift) != 0;
758 INLINE PN_stdfloat TextProperties::
759 get_glyph_shift()
const {
772 _text_scale = text_scale;
773 _specified |= F_has_text_scale;
779 INLINE
void TextProperties::
781 _specified &= ~F_has_text_scale;
788 INLINE
bool TextProperties::
789 has_text_scale()
const {
790 return (_specified & F_has_text_scale) != 0;
796 INLINE PN_stdfloat TextProperties::
797 get_text_scale()
const {
809 _direction = direction;
810 _specified |= F_has_direction;
819 INLINE
void TextProperties::
821 _specified &= ~F_has_direction;
828 INLINE
bool TextProperties::
829 has_direction()
const {
830 return (_specified & F_has_direction) != 0;
838 INLINE TextProperties::Direction TextProperties::
839 get_direction()
const {
bool is_any_specified() const
Returns true if any properties have been specified, false otherwise.
set_align
Specifies the alignment of the text within its margins.
set_direction
Specifies the text direction.
set_text_scale
Specifies the factor by which to scale the text, in addition to any scalings imposed by the node,...
set_glyph_scale
Specifies the factor by which to scale each letter of the text as it is placed, in addition to any sc...
static TextFont * get_default_font()
Specifies the default font to be used for any TextNode whose font is uninitialized or NULL.
set_preserve_trailing_whitespace
Sets the preserve_trailing_whitespace flag.
set_underscore_height
Specifies the vertical height of the underscore, relative to the text baseline.
An encapsulation of a font; i.e.
set_tab_width
Sets the width of each tab stop, in screen units.
set_shadow
Specifies that the text should be drawn with a shadow, by creating a second copy of the text and offs...
set_draw_order
Sets the drawing order of text created by the TextNode.
static void set_default_font(TextFont *)
Specifies the default font to be used for any TextNode whose font is uninitialized or NULL.
set_small_caps
Sets the small_caps flag.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
set_wordwrap
Sets the text up to automatically wordwrap when it exceeds the indicated width.
set_glyph_shift
Specifies a vertical amount to shift each letter of the text as it is placed.
set_slant
Specifies the factor by which the text slants to the right.
set_indent
Specifies the amount of extra space that is inserted before the first character of each line.
set_bin
Names the CullBin that the text geometry should be assigned to.
This defines the set of visual properties that may be assigned to the individual characters of the te...
set_underscore
Sets the underscore flag.
set_small_caps_scale
Sets the scale factor applied to lowercase letters from their uppercase equivalents,...
set_font
Sets the font that will be used when making text.