// process the u1 attribute
StringTokenizer st = new StringTokenizer(u1, ",");
while (st.hasMoreTokens()) {
String token = st.nextToken();
if (token.startsWith("U+")) { // its a unicode range
firstUnicodeRanges.add(new UnicodeRange(token));
} else {
int[] glyphCodes = font.getGlyphCodesForUnicode(token);
if (firstGlyphSet == null) {
firstGlyphSet = glyphCodes;
firstGlyphLen = glyphCodes.length;
}else {
if ((firstGlyphLen + glyphCodes.length) >
firstGlyphSet.length) {
int sz = firstGlyphSet.length*2;
if (sz <firstGlyphLen + glyphCodes.length)
sz = firstGlyphLen + glyphCodes.length;
int [] tmp = new int[sz];
System.arraycopy( firstGlyphSet, 0, tmp, 0, firstGlyphLen );
firstGlyphSet = tmp;
}
for (int i = 0; i < glyphCodes.length; i++)
firstGlyphSet[firstGlyphLen++] = glyphCodes[i];
}
}
}
// process the u2 attrbute
st = new StringTokenizer(u2, ",");
while (st.hasMoreTokens()) {
String token = st.nextToken();
if (token.startsWith("U+")) { // its a unicode range
secondUnicodeRanges.add(new UnicodeRange(token));
} else {
int[] glyphCodes = font.getGlyphCodesForUnicode(token);
if (secondGlyphSet == null) {
secondGlyphSet = glyphCodes;
secondGlyphLen = glyphCodes.length;