+ if(glyph)
+ FT_Done_Glyph(glyph);
+ font->glyph2ascii[font->numchars] = font->glyph2ascii[t];
+ glyph2glyph[t] = font->numchars;
+ font->numchars++;
+ }
+
+ //font->layout->ascent = abs(face->ascender)*FT_SCALE*loadfont_scale*20/FT_SUBPIXELS/2; //face->bbox.xMin;
+ //font->layout->descent = abs(face->descender)*FT_SCALE*loadfont_scale*20/FT_SUBPIXELS/2; //face->bbox.xMax;
+ //font->layout->leading = font->layout->ascent + font->layout->descent;
+
+ if(-fontbbox.ymin < 0)
+ font->layout->ascent = 0;
+ else
+ font->layout->ascent = -fontbbox.ymin;
+
+ if(fontbbox.ymax < 0)
+ font->layout->descent = 0;
+ else
+ font->layout->descent = fontbbox.ymax;
+
+ int leading = fontbbox.ymax - fontbbox.ymin;
+ font->layout->leading = leading>0x7fff?0x7fff:leading;
+
+ /* notice: if skip_unused is true, font->glyph2ascii, font->glyphnames and font->layout->bounds will
+ have more memory allocated than just font->numchars, but only the first font->numchars
+ are used/valid */
+
+ for(t=0;t<font->maxascii;t++) {
+ if(font->ascii2glyph[t]>=0) {
+ font->ascii2glyph[t] = glyph2glyph[font->ascii2glyph[t]];
+ }