}
}
if(qName.equalsIgnoreCase(SVGConstants.SVG_GLYPH_TAG)|| qName.equalsIgnoreCase(SVGConstants.SVG_MISSING_GLYPH_TAG)){
VectorFontCharacter currentCharacter = null;
for ( int i = 0; i < attributes.getLength(); i++ ){
String currentAttributeName = attributes.getQName(i);
String currentAttribueValue = attributes.getValue(i);
if (currentAttributeName.equalsIgnoreCase("d")){
// ArrayList<SvgFontCharacter> characters = extractPath(currentAttribueValue);
//Parse the Paths's "d" attribute and create a new character
pathHandler = new CustomPathHandler();
pathParser.setPathHandler(pathHandler);
pathParser.parse(currentAttribueValue);
currentCharacter = this.createCharacter(pathHandler);
//Set unicode/name for missing glyph by hand
if (qName.equalsIgnoreCase("missing-glyph")){
currentUnicode = "missing-glyph";
currentGlyphName = "missing-glyph";
}
}else if (currentAttributeName.equalsIgnoreCase("unicode")){
currentUnicode = currentAttribueValue;
if (currentUnicode.equalsIgnoreCase(" ")){
Vertex[] spaceVerts = new Vertex[]{new Vertex(0,0,0), new Vertex(fontDefaultXAdvancing,0,0),new Vertex(fontDefaultXAdvancing,100,0), /*new Vertex(0,100,0)*/};
ArrayList<Vertex[]> spaceContours = new ArrayList<Vertex[]>();
spaceContours.add(spaceVerts);
VectorFontCharacter spaceCharacter = new VectorFontCharacter(spaceContours, pa);
// VectorFontCharacter spaceCharacter = new VectorFontCharacter(new Vertex[]{new Vertex(0,0,0), new Vertex(100,0,0),new Vertex(100,100,0),new Vertex(0,100,0)}, new ArrayList<Vertex[]>(), pa);
spaceCharacter.setPickable(false);
if (MT4jSettings.getInstance().isOpenGlMode()){
spaceCharacter.setUseDirectGL(true);
// spaceCharacter.generateAndUseDisplayLists();
}
spaceCharacter.setVisible(false);
spaceCharacter.setNoFill(true);
spaceCharacter.setNoStroke(true);
currentCharacter = spaceCharacter;
}
}else if (currentAttributeName.equalsIgnoreCase("glyph-name")){
currentGlyphName = currentAttribueValue;
if (currentUnicode.equalsIgnoreCase("space")){
Vertex[] spaceVerts = new Vertex[]{new Vertex(0,0,0), new Vertex(fontDefaultXAdvancing,0,0),new Vertex(fontDefaultXAdvancing,100,0), /*new Vertex(0,100,0)*/};
ArrayList<Vertex[]> spaceContours = new ArrayList<Vertex[]>();
spaceContours.add(spaceVerts);
VectorFontCharacter spaceCharacter = new VectorFontCharacter(spaceContours, pa);
// VectorFontCharacter spaceCharacter = new VectorFontCharacter(new Vertex[]{new Vertex(0,0,0), new Vertex(100,0,0),new Vertex(100,100,0),new Vertex(0,100,0)}, new ArrayList<Vertex[]>(), pa);
spaceCharacter.setPickable(false);
if (MT4jSettings.getInstance().isOpenGlMode()){
spaceCharacter.setUseDirectGL(true);
// spaceCharacter.generateAndUseDisplayLists();
}
spaceCharacter.setVisible(false);
spaceCharacter.setNoFill(true);
spaceCharacter.setNoStroke(true);
currentCharacter = spaceCharacter;
}
}else if (currentAttributeName.equalsIgnoreCase("horiz-adv-x")){
currenthorizontalAdvX = Integer.parseInt(currentAttribueValue);
}