
2258.3. Text Class Details
}
tabW -= scaledWidth;
}
}
break;
case '\b': // Backspace
stringWidth -= scaledWidth;
if(stringWidth < 0)
stringWidth = 0;
break;
case 0x01: // Special
stringWidth += scaledWidth;
break;
}
}
}
if(strW==0)
strW = stringWidth;
w = strW;
return;
}
Listing 8.26. e getWidthHeight function calculates the screen space required to display the
string.
8.3.5 Draw a Character
e drawChar function does the actual drawing of characters to the screen. It also dis-
plays background color and does underline and bold. If backColor is set to a color
other than TRANSCOLOR, the character dened by the constant SOLID is displayed using ...