public static Phrase GetInstance(int leading, String str, Font font) {
Phrase p = new Phrase(true);
p.Leading = leading;
p.font = font;
if (font.Family != Font.SYMBOL && font.Family != Font.ZAPFDINGBATS && font.BaseFont == null) {
int index;
while ((index = SpecialSymbol.Index(str)) > -1) {
if (index > 0) {
String firstPart = str.Substring(0, index);
((ArrayList)p).Add(new Chunk(firstPart, font));
str = str.Substring(index);
}
Font symbol = new Font(Font.SYMBOL, font.Size, font.Style, font.Color);
StringBuilder buf = new StringBuilder();
buf.Append(SpecialSymbol.GetCorrespondingSymbol(str[0]));
str = str.Substring(1);
while (SpecialSymbol.Index(str) == 0) {
buf.Append(SpecialSymbol.GetCorrespondingSymbol(str[0]));
str = str.Substring(1);
}
((ArrayList)p).Add(new Chunk(buf.ToString(), symbol));
}
}
if (str != null && str.Length != 0) {
((ArrayList)p).Add(new Chunk(str, font));
}
return p;
}
}