text scaling bug

Return to Panda Features in Development

text scaling bug

Postby Sam » Fri Jun 01, 2012 8:39 pm

It appears that TextNode::set_text_scale does not properly handle spaces. They do not get scaled, so it appears that text is rendered without spaces.

The bug is in TextAssembler::assemble_row where the handling for spaces (and tabs) does not account for scaling.

Code: Select all
    if (character == ' ') {
      // A space is a special case.
      xpos += font->get_space_advance();


should change to:
Code: Select all
    if (character == ' ') {
      // A space is a special case.
      xpos += properties->get_glyph_scale() * properties->get_text_scale() * font->get_space_advance();


Can someone review and apply?
Sam
 
Posts: 19
Joined: Tue Mar 09, 2010 3:11 pm
Location: LA, CA

Postby teedee » Wed Jun 06, 2012 11:38 pm

It would be a good idea to submit the bug and patch on the bug tracker. It is a lot easier for bugs posted on the forum to be missed or forgotten.
https://bugs.launchpad.net/panda3d
teedee
 
Posts: 782
Joined: Tue May 12, 2009 11:33 pm
Location: Kepler-22b

Postby Sam » Thu Jun 14, 2012 5:41 pm

Sam
 
Posts: 19
Joined: Tue Mar 09, 2010 3:11 pm
Location: LA, CA


Return to Panda Features in Development

Who is online

Users browsing this forum: No registered users and 0 guests