continue;
}
GlyphSlot slot = face.getGlyph();
GlyphMetrics metrics = slot.getMetrics();
Bitmap bitmap = slot.getBitmap();
Pixmap pixmap = bitmap.getPixmap(Format.RGBA8888);
Glyph glyph = new Glyph();
glyph.id = (int)c;
glyph.width = pixmap.getWidth();
glyph.height = pixmap.getHeight();
glyph.xoffset = slot.getBitmapLeft();
glyph.yoffset = parameter.flip ? -slot.getBitmapTop() + (int)baseLine : -(glyph.height - slot.getBitmapTop())
- (int)baseLine;
glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance());
if (bitmapped) {
pixmap.setColor(Color.CLEAR);
pixmap.fill();
ByteBuffer buf = bitmap.getBuffer();
for (int h = 0; h < glyph.height; h++) {
int idx = h * bitmap.getPitch();
for (int w = 0; w < (glyph.width + glyph.xoffset); w++) {
int bit = (buf.get(idx + (w / 8)) >>> (7 - (w % 8))) & 1;
pixmap.drawPixel(w, h, ((bit == 1) ? Color.WHITE.toIntBits() : Color.CLEAR.toIntBits()));
}
}
}
String name = packPrefix + c;
Rectangle rect = packer.pack(name, pixmap);
// determine which page it was packed into
int pIndex = packer.getPageIndex(name);
if (pIndex == -1) // we should not get here
throw new IllegalStateException("packer was not able to insert '" + name + "' into a page");
glyph.page = pIndex;
glyph.srcX = (int)rect.x;
glyph.srcY = (int)rect.y;
data.setGlyph(c, glyph);
pixmap.dispose();
}
// generate kerning
for (int i = 0; i < parameter.characters.length(); i++) {
for (int j = 0; j < parameter.characters.length(); j++) {