mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
matPages[index] = mat;
}
}else if (tokens[0].equals("char")){
// New BitmapCharacter
BitmapCharacter ch = null;
for (int i = 1; i < tokens.length; i++){
String token = tokens[i];
if (token.equals("id")){
int index = Integer.parseInt(tokens[i + 1]);
ch = new BitmapCharacter();
charSet.addCharacter(index, ch);
}else if (token.equals("x")){
ch.setX(Integer.parseInt(tokens[i + 1]));
}else if (token.equals("y")){
ch.setY(Integer.parseInt(tokens[i + 1]));
}else if (token.equals("width")){
ch.setWidth(Integer.parseInt(tokens[i + 1]));
}else if (token.equals("height")){
ch.setHeight(Integer.parseInt(tokens[i + 1]));
}else if (token.equals("xoffset")){
ch.setXOffset(Integer.parseInt(tokens[i + 1]));
}else if (token.equals("yoffset")){
ch.setYOffset(Integer.parseInt(tokens[i + 1]));
}else if (token.equals("xadvance")){
ch.setXAdvance(Integer.parseInt(tokens[i + 1]));
} else if (token.equals("page")) {
ch.setPage(Integer.parseInt(tokens[i + 1]));
}
}
}else if (tokens[0].equals("kerning")){
// Build kerning list
int index = 0;
int second = 0;
int amount = 0;
for (int i = 1; i < tokens.length; i++){
if (tokens[i].equals("first")){
index = Integer.parseInt(tokens[i + 1]);
}else if (tokens[i].equals("second")){
second = Integer.parseInt(tokens[i + 1]);
}else if (tokens[i].equals("amount")){
amount = Integer.parseInt(tokens[i + 1]);
}
}
BitmapCharacter ch = charSet.getCharacter(index);
ch.addKerning(second, amount);
}
}
return font;
}