+ for(t=0;t<font->num_glyphs;t++) {
+ SRECT bbox = swffont->layout->bounds[t];
+
+ /* if the glyph doesn't have a bounding box, use the
+ combined bounding box (necessary e.g. for space characters) */
+ if(!(bbox.xmin|bbox.ymin|bbox.xmax|bbox.ymax)) {
+ swffont->layout->bounds[t] = bbox = max;
+ }
+
+ /* check that the advance value is reasonable, by comparing it
+ with the bounding box */
+ if(bbox.xmax>0 && (bbox.xmax*2 < swffont->glyph[t].advance || !swffont->glyph[t].advance)) {
+ if(swffont->glyph[t].advance)
+ msg("<warning> fix bad advance value: bbox=%.2f, advance=%.2f\n", bbox.xmax/20.0, swffont->glyph[t].advance/20.0);
+ swffont->glyph[t].advance = bbox.xmax;
+ }
+ }