00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 INLINE bool TextProperties::
00022 operator != (const TextProperties &other) const {
00023 return !operator == (other);
00024 }
00025
00026
00027
00028
00029
00030
00031
00032 INLINE bool TextProperties::
00033 is_any_specified() const {
00034 return (_specified != 0);
00035 }
00036
00037
00038
00039
00040
00041
00042
00043
00044 INLINE void TextProperties::
00045 set_default_font(TextFont *font) {
00046
00047
00048 _loaded_default_font = true;
00049 _default_font = font;
00050 }
00051
00052
00053
00054
00055
00056
00057
00058
00059 INLINE TextFont *TextProperties::
00060 get_default_font() {
00061 if (!_loaded_default_font) {
00062 load_default_font();
00063 }
00064 return _default_font;
00065 }
00066
00067
00068
00069
00070
00071
00072
00073
00074 INLINE void TextProperties::
00075 set_font(TextFont *font) {
00076 _font = font;
00077 _specified |= F_has_font;
00078 }
00079
00080
00081
00082
00083
00084
00085 INLINE void TextProperties::
00086 clear_font() {
00087 _font.clear();
00088 _specified &= ~F_has_font;
00089 }
00090
00091
00092
00093
00094
00095
00096 INLINE bool TextProperties::
00097 has_font() const {
00098 return (_specified & F_has_font) != 0;
00099 }
00100
00101
00102
00103
00104
00105
00106
00107 INLINE TextFont *TextProperties::
00108 get_font() const {
00109 return has_font() ? _font.p() : get_default_font();
00110 }
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 INLINE void TextProperties::
00134 set_small_caps(bool small_caps) {
00135 _small_caps = small_caps;
00136 _specified |= F_has_small_caps;
00137 }
00138
00139
00140
00141
00142
00143
00144 INLINE void TextProperties::
00145 clear_small_caps() {
00146 _small_caps = false;
00147 _specified &= ~F_has_small_caps;
00148 }
00149
00150
00151
00152
00153
00154
00155 INLINE bool TextProperties::
00156 has_small_caps() const {
00157 return (_specified & F_has_small_caps) != 0;
00158 }
00159
00160
00161
00162
00163
00164
00165 INLINE bool TextProperties::
00166 get_small_caps() const {
00167 return _small_caps;
00168 }
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178 INLINE void TextProperties::
00179 set_small_caps_scale(PN_stdfloat small_caps_scale) {
00180 _small_caps_scale = small_caps_scale;
00181 }
00182
00183
00184
00185
00186
00187
00188 INLINE void TextProperties::
00189 clear_small_caps_scale() {
00190 _small_caps_scale = text_small_caps_scale;
00191 _specified &= ~F_has_small_caps_scale;
00192 }
00193
00194
00195
00196
00197
00198
00199 INLINE bool TextProperties::
00200 has_small_caps_scale() const {
00201 return (_specified & F_has_small_caps_scale) != 0;
00202 }
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212 INLINE PN_stdfloat TextProperties::
00213 get_small_caps_scale() const {
00214 return _small_caps_scale;
00215 }
00216
00217
00218
00219
00220
00221
00222
00223 INLINE void TextProperties::
00224 set_slant(PN_stdfloat slant) {
00225 _slant = slant;
00226 _specified |= F_has_slant;
00227 }
00228
00229
00230
00231
00232
00233
00234 INLINE void TextProperties::
00235 clear_slant() {
00236 _slant = 0.0f;
00237 _specified &= ~F_has_slant;
00238 }
00239
00240
00241
00242
00243
00244
00245 INLINE bool TextProperties::
00246 has_slant() const {
00247 return (_specified & F_has_slant) != 0;
00248 }
00249
00250
00251
00252
00253
00254
00255
00256 INLINE PN_stdfloat TextProperties::
00257 get_slant() const {
00258 return _slant;
00259 }
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269 INLINE void TextProperties::
00270 set_underscore(bool underscore) {
00271 _underscore = underscore;
00272 _specified |= F_has_underscore;
00273 }
00274
00275
00276
00277
00278
00279
00280 INLINE void TextProperties::
00281 clear_underscore() {
00282 _underscore = false;
00283 _specified &= ~F_has_underscore;
00284 }
00285
00286
00287
00288
00289
00290
00291 INLINE bool TextProperties::
00292 has_underscore() const {
00293 return (_specified & F_has_underscore) != 0;
00294 }
00295
00296
00297
00298
00299
00300
00301 INLINE bool TextProperties::
00302 get_underscore() const {
00303 return _underscore;
00304 }
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314 INLINE void TextProperties::
00315 set_underscore_height(PN_stdfloat underscore_height) {
00316 _underscore_height = underscore_height;
00317 _specified |= F_has_underscore_height;
00318 }
00319
00320
00321
00322
00323
00324
00325 INLINE void TextProperties::
00326 clear_underscore_height() {
00327 _underscore_height = 0.0f;
00328 _specified &= ~F_has_underscore_height;
00329 }
00330
00331
00332
00333
00334
00335
00336 INLINE bool TextProperties::
00337 has_underscore_height() const {
00338 return (_specified & F_has_underscore_height) != 0;
00339 }
00340
00341
00342
00343
00344
00345
00346
00347 INLINE PN_stdfloat TextProperties::
00348 get_underscore_height() const {
00349 return has_underscore_height() ? _underscore_height : text_default_underscore_height;
00350 }
00351
00352
00353
00354
00355
00356
00357
00358 INLINE void TextProperties::
00359 set_align(TextProperties::Alignment align_type) {
00360 _align = align_type;
00361 _specified |= F_has_align;
00362 }
00363
00364
00365
00366
00367
00368
00369 INLINE void TextProperties::
00370 clear_align() {
00371 _align = A_left;
00372 _specified &= ~F_has_align;
00373 }
00374
00375
00376
00377
00378
00379
00380 INLINE bool TextProperties::
00381 has_align() const {
00382 return (_specified & F_has_align) != 0;
00383 }
00384
00385
00386
00387
00388
00389
00390 INLINE TextProperties::Alignment TextProperties::
00391 get_align() const {
00392 return _align;
00393 }
00394
00395
00396
00397
00398
00399
00400
00401
00402 INLINE void TextProperties::
00403 set_indent(PN_stdfloat indent) {
00404 _indent_width = indent;
00405 _specified |= F_has_indent;
00406 }
00407
00408
00409
00410
00411
00412
00413
00414 INLINE void TextProperties::
00415 clear_indent() {
00416 _indent_width = 0.0f;
00417 _specified &= ~F_has_indent;
00418 }
00419
00420
00421
00422
00423
00424
00425 INLINE bool TextProperties::
00426 has_indent() const {
00427 return (_specified & F_has_indent) != 0;
00428 }
00429
00430
00431
00432
00433
00434
00435 INLINE PN_stdfloat TextProperties::
00436 get_indent() const {
00437 return _indent_width;
00438 }
00439
00440
00441
00442
00443
00444
00445
00446
00447 INLINE void TextProperties::
00448 set_wordwrap(PN_stdfloat wordwrap) {
00449 _wordwrap_width = wordwrap;
00450 _specified |= F_has_wordwrap;
00451 }
00452
00453
00454
00455
00456
00457
00458
00459 INLINE void TextProperties::
00460 clear_wordwrap() {
00461 _wordwrap_width = 0.0f;
00462 _specified &= ~F_has_wordwrap;
00463 }
00464
00465
00466
00467
00468
00469
00470 INLINE bool TextProperties::
00471 has_wordwrap() const {
00472 return (_specified & F_has_wordwrap) != 0;
00473 }
00474
00475
00476
00477
00478
00479
00480 INLINE PN_stdfloat TextProperties::
00481 get_wordwrap() const {
00482 return _wordwrap_width;
00483 }
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496 INLINE void TextProperties::
00497 set_preserve_trailing_whitespace(bool preserve_trailing_whitespace) {
00498 _preserve_trailing_whitespace = preserve_trailing_whitespace;
00499 _specified |= F_has_preserve_trailing_whitespace;
00500 }
00501
00502
00503
00504
00505
00506
00507 INLINE void TextProperties::
00508 clear_preserve_trailing_whitespace() {
00509 _preserve_trailing_whitespace = false;
00510 _specified &= ~F_has_preserve_trailing_whitespace;
00511 }
00512
00513
00514
00515
00516
00517
00518 INLINE bool TextProperties::
00519 has_preserve_trailing_whitespace() const {
00520 return (_specified & F_has_preserve_trailing_whitespace) != 0;
00521 }
00522
00523
00524
00525
00526
00527
00528
00529 INLINE bool TextProperties::
00530 get_preserve_trailing_whitespace() const {
00531 return _preserve_trailing_whitespace;
00532 }
00533
00534
00535
00536
00537
00538
00539 INLINE void TextProperties::
00540 set_text_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
00541 set_text_color(LColor(r, g, b, a));
00542 }
00543
00544
00545
00546
00547
00548
00549 INLINE void TextProperties::
00550 set_text_color(const LColor &text_color) {
00551 _text_color = text_color;
00552 _specified |= F_has_text_color;
00553 }
00554
00555
00556
00557
00558
00559
00560
00561 INLINE void TextProperties::
00562 clear_text_color() {
00563 _text_color.set(1.0f, 1.0f, 1.0f, 1.0f);
00564 _specified &= ~F_has_text_color;
00565 }
00566
00567
00568
00569
00570
00571
00572 INLINE bool TextProperties::
00573 has_text_color() const {
00574 return (_specified & F_has_text_color) != 0;
00575 }
00576
00577
00578
00579
00580
00581
00582 INLINE LColor TextProperties::
00583 get_text_color() const {
00584 return _text_color;
00585 }
00586
00587
00588
00589
00590
00591
00592 INLINE void TextProperties::
00593 set_shadow_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
00594 set_shadow_color(LColor(r, g, b, a));
00595 }
00596
00597
00598
00599
00600
00601
00602 INLINE void TextProperties::
00603 set_shadow_color(const LColor &shadow_color) {
00604 _shadow_color = shadow_color;
00605 _specified |= F_has_shadow_color;
00606 }
00607
00608
00609
00610
00611
00612
00613 INLINE void TextProperties::
00614 clear_shadow_color() {
00615 _shadow_color.set(0.0f, 0.0f, 0.0f, 1.0f);
00616 _specified &= ~F_has_shadow_color;
00617 }
00618
00619
00620
00621
00622
00623
00624 INLINE bool TextProperties::
00625 has_shadow_color() const {
00626 return (_specified & F_has_shadow_color) != 0;
00627 }
00628
00629
00630
00631
00632
00633
00634 INLINE LColor TextProperties::
00635 get_shadow_color() const {
00636 return _shadow_color;
00637 }
00638
00639
00640
00641
00642
00643
00644
00645
00646 INLINE void TextProperties::
00647 set_shadow(PN_stdfloat xoffset, PN_stdfloat yoffset) {
00648 set_shadow(LVecBase2(xoffset, yoffset));
00649 }
00650
00651
00652
00653
00654
00655
00656
00657
00658 INLINE void TextProperties::
00659 set_shadow(const LVecBase2 &shadow_offset) {
00660 _shadow_offset = shadow_offset;
00661 _specified |= F_has_shadow;
00662 }
00663
00664
00665
00666
00667
00668
00669
00670 INLINE void TextProperties::
00671 clear_shadow() {
00672 _specified &= ~F_has_shadow;
00673 _shadow_offset.set(0.0f, 0.0f);
00674 }
00675
00676
00677
00678
00679
00680
00681 INLINE bool TextProperties::
00682 has_shadow() const {
00683 return (_specified & F_has_shadow) != 0;
00684 }
00685
00686
00687
00688
00689
00690
00691
00692
00693 INLINE LVector2 TextProperties::
00694 get_shadow() const {
00695 return _shadow_offset;
00696 }
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710 INLINE void TextProperties::
00711 set_bin(const string &bin) {
00712 _bin = bin;
00713 _specified |= F_has_bin;
00714 }
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724 INLINE void TextProperties::
00725 clear_bin() {
00726 _bin = string();
00727 _specified &= ~F_has_bin;
00728 }
00729
00730
00731
00732
00733
00734
00735
00736 INLINE bool TextProperties::
00737 has_bin() const {
00738 return (_specified & F_has_bin) != 0;
00739 }
00740
00741
00742
00743
00744
00745
00746
00747 INLINE const string &TextProperties::
00748 get_bin() const {
00749 return _bin;
00750 }
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767 INLINE int TextProperties::
00768 set_draw_order(int draw_order) {
00769 _draw_order = draw_order;
00770 _specified |= F_has_draw_order;
00771 return _draw_order + 3;
00772 }
00773
00774
00775
00776
00777
00778
00779 INLINE void TextProperties::
00780 clear_draw_order() {
00781 _draw_order = 1;
00782 _specified &= ~F_has_draw_order;
00783 }
00784
00785
00786
00787
00788
00789
00790 INLINE bool TextProperties::
00791 has_draw_order() const {
00792 return (_specified & F_has_draw_order) != 0;
00793 }
00794
00795
00796
00797
00798
00799
00800 INLINE int TextProperties::
00801 get_draw_order() const {
00802 return _draw_order;
00803 }
00804
00805
00806
00807
00808
00809
00810
00811
00812 INLINE void TextProperties::
00813 set_tab_width(PN_stdfloat tab_width) {
00814 _tab_width = tab_width;
00815 _specified |= F_has_tab_width;
00816 }
00817
00818
00819
00820
00821
00822
00823 INLINE void TextProperties::
00824 clear_tab_width() {
00825 _tab_width = text_tab_width;
00826 _specified &= ~F_has_tab_width;
00827 }
00828
00829
00830
00831
00832
00833
00834 INLINE bool TextProperties::
00835 has_tab_width() const {
00836 return (_specified & F_has_tab_width) != 0;
00837 }
00838
00839
00840
00841
00842
00843
00844 INLINE PN_stdfloat TextProperties::
00845 get_tab_width() const {
00846 return _tab_width;
00847 }
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866 INLINE void TextProperties::
00867 set_glyph_scale(PN_stdfloat glyph_scale) {
00868 _glyph_scale = glyph_scale;
00869 _specified |= F_has_glyph_scale;
00870 }
00871
00872
00873
00874
00875
00876
00877 INLINE void TextProperties::
00878 clear_glyph_scale() {
00879 _specified &= ~F_has_glyph_scale;
00880 _glyph_scale = 0.0f;
00881 }
00882
00883
00884
00885
00886
00887
00888 INLINE bool TextProperties::
00889 has_glyph_scale() const {
00890 return (_specified & F_has_glyph_scale) != 0;
00891 }
00892
00893
00894
00895
00896
00897
00898
00899 INLINE PN_stdfloat TextProperties::
00900 get_glyph_scale() const {
00901 return _glyph_scale;
00902 }
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912 INLINE void TextProperties::
00913 set_glyph_shift(PN_stdfloat glyph_shift) {
00914 _glyph_shift = glyph_shift;
00915 _specified |= F_has_glyph_shift;
00916 }
00917
00918
00919
00920
00921
00922
00923 INLINE void TextProperties::
00924 clear_glyph_shift() {
00925 _specified &= ~F_has_glyph_shift;
00926 _glyph_shift = 0.0f;
00927 }
00928
00929
00930
00931
00932
00933
00934 INLINE bool TextProperties::
00935 has_glyph_shift() const {
00936 return (_specified & F_has_glyph_shift) != 0;
00937 }
00938
00939
00940
00941
00942
00943
00944
00945 INLINE PN_stdfloat TextProperties::
00946 get_glyph_shift() const {
00947 return _glyph_shift;
00948 }
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961 INLINE void TextProperties::
00962 set_text_scale(PN_stdfloat text_scale) {
00963 _text_scale = text_scale;
00964 _specified |= F_has_text_scale;
00965 }
00966
00967
00968
00969
00970
00971
00972 INLINE void TextProperties::
00973 clear_text_scale() {
00974 _specified &= ~F_has_text_scale;
00975 _text_scale = 0.0f;
00976 }
00977
00978
00979
00980
00981
00982
00983 INLINE bool TextProperties::
00984 has_text_scale() const {
00985 return (_specified & F_has_text_scale) != 0;
00986 }
00987
00988
00989
00990
00991
00992
00993
00994 INLINE PN_stdfloat TextProperties::
00995 get_text_scale() const {
00996 return _text_scale;
00997 }