for (int f = 0; f < fsize; ++f) {
font = (LwgFont)fonts.get(f);
if (font.getBaseFont().charExists(u)) {
if (lastidx != f) {
if (sb.length() > 0 && lastidx != -1) {
Chunk ck = new Chunk(sb.toString(), (LwgFont)fonts.get(lastidx));
ret.add(ck);
sb.setLength(0);
}
lastidx = f;
}
sb.append(c);
sb.append(cc[++k]);
break;
}
}
}
else {
for (int f = 0; f < fsize; ++f) {
font = (LwgFont)fonts.get(f);
if (font.getBaseFont().charExists(c)) {
if (lastidx != f) {
if (sb.length() > 0 && lastidx != -1) {
Chunk ck = new Chunk(sb.toString(), (LwgFont)fonts.get(lastidx));
ret.add(ck);
sb.setLength(0);
}
lastidx = f;
}
sb.append(c);
break;
}
}
}
}
if (sb.length() > 0) {
Chunk ck = new Chunk(sb.toString(), (LwgFont)fonts.get(lastidx == -1 ? 0 : lastidx));
ret.add(ck);
}
return ret;
}