- SRECT rn = font->layout->bounds[g];
- rn.xmin = (rn.xmin * scale)/100 + pos;
- rn.xmax = (rn.xmax * scale)/100 + pos;
- rn.ymin = (rn.ymin * scale)/100;
- rn.ymax = (rn.ymax * scale)/100;
- swf_ExpandRect2(&r, &rn);
- pos += (font->glyph[g].advance*scale*20)/100;
+ if(g>=0) {
+ SRECT rn = font->layout->bounds[g];
+ rn.xmin = (rn.xmin * scale)/100 + pos;
+ rn.xmax = (rn.xmax * scale)/100 + pos;
+ rn.ymin = (rn.ymin * scale)/100;
+ rn.ymax = (rn.ymax * scale)/100;
+ swf_ExpandRect2(&r, &rn);
+ pos += (font->glyph[g].advance*scale*20)/100;
+ }