22 _usage_hint = usage_hint;
60 _dynamic_merge = dynamic_merge;
68 return _dynamic_merge;
77 _multiline_mode = flag;
85 return _multiline_mode;
94 _initial_cprops =
new ComputedProperties(properties);
103 return _initial_cprops->_properties;
163 return _text_string.size();
173 nassertr(n >= 0 && n < (
int)_text_string.size(), 0);
174 return _text_string[n]._character;
184 nassertr(n >= 0 && n < (
int)_text_string.size(), 0);
185 return _text_string[n]._graphic;
194 nassertr(n >= 0 && n < (
int)_text_string.size(), *(
new TextProperties()));
195 return _text_string[n]._cprops->_properties;
204 nassertr(n >= 0 && n < (
int)_text_string.size(), 0.0f);
215 return _text_block.size();
223 nassertr(r >= 0 && r <= (
int)_text_block.size(), 0);
224 if (r == (
int)_text_block.size()) {
227 return _text_block[r]._string.size();
237 nassertr(r >= 0 && r < (
int)_text_block.size(), 0);
238 nassertr(c >= 0 && c < (
int)_text_block[r]._string.size(), 0);
239 return _text_block[r]._string[c]._character;
249 nassertr(r >= 0 && r < (
int)_text_block.size(), 0);
250 nassertr(c >= 0 && c < (
int)_text_block[r]._string.size(), 0);
251 return _text_block[r]._string[c]._graphic;
260 nassertr(r >= 0 && r < (
int)_text_block.size(), *(
new TextProperties()));
261 nassertr(c >= 0 && c < (
int)_text_block[r]._string.size(), *(
new TextProperties()));
262 return _text_block[r]._string[c]._cprops->_properties;
271 nassertr(r >= 0 && r < (
int)_text_block.size(), 0.0f);
272 nassertr(c >= 0 && c < (
int)_text_block[r]._string.size(), 0.0f);
286 nassertr(r >= 0 && r <= (
int)_text_block.size(), 0.0f);
287 if (r == (
int)_text_block.size()) {
288 return _next_row_ypos;
290 return _text_block[r]._ypos;
299 if (tch._graphic !=
nullptr) {
300 return calc_width(tch._graphic, tch._cprops->_properties);
302 return calc_width(tch._character, tch._cprops->_properties);
309 INLINE TextAssembler::TextCharacter::
310 TextCharacter(
wchar_t character,
311 TextAssembler::ComputedProperties *cprops) :
312 _character(character),
321 INLINE TextAssembler::TextCharacter::
322 TextCharacter(
const TextGraphic *graphic,
const std::wstring &graphic_wname,
323 TextAssembler::ComputedProperties *cprops) :
326 _graphic_wname(graphic_wname),
334 INLINE TextAssembler::TextCharacter::
335 TextCharacter(
const TextAssembler::TextCharacter ©) :
336 _character(copy._character),
337 _graphic(copy._graphic),
338 _graphic_wname(copy._graphic_wname),
339 _cprops(copy._cprops)
346 INLINE
void TextAssembler::TextCharacter::
347 operator = (
const TextAssembler::TextCharacter ©) {
348 _character = copy._character;
349 _graphic = copy._graphic;
350 _graphic_wname = copy._graphic_wname;
351 _cprops = copy._cprops;
357 INLINE TextAssembler::TextRow::
358 TextRow(
int row_start) :
359 _row_start(row_start),
360 _got_soft_hyphens(false),
369 INLINE TextAssembler::TextRow::
370 TextRow(
const TextAssembler::TextRow ©) :
371 _string(copy._string),
372 _row_start(copy._row_start),
373 _got_soft_hyphens(copy._got_soft_hyphens),
376 _eol_cprops(copy._eol_cprops)
383 INLINE
void TextAssembler::TextRow::
384 operator = (
const TextAssembler::TextRow ©) {
385 _string = copy._string;
386 _row_start = copy._row_start;
387 _got_soft_hyphens = copy._got_soft_hyphens;
390 _eol_cprops = copy._eol_cprops;
396 INLINE TextAssembler::ComputedProperties::
400 _properties(orig_properties)
407 INLINE TextAssembler::ComputedProperties::
408 ComputedProperties(ComputedProperties *based_on,
const std::wstring &wname,
411 _depth(_based_on->_depth + 1),
413 _properties(based_on->_properties)
423 if (named_props !=
nullptr) {
427 <<
"Unknown TextProperties: " << name <<
"\n";
434 INLINE TextAssembler::GeomCollectorKey::
444 INLINE
bool TextAssembler::GeomCollectorKey::
445 operator < (
const TextAssembler::GeomCollectorKey &other)
const {
446 if (_state != other._state) {
447 return _state < other._state;
449 return _format < other._format;
460 INLINE
void TextAssembler::GeomCollector::
461 count_geom(
const Geom *geom) {
463 _geom->count_geom(geom);