该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
public Vector getLinebreakNum(FontMetrics frm,String s,Font font,int maxWidth
)
{
Vector breakLines=new Vector();
StringCharacterIterator str=new StringCharacterIterator(formatTabString(s));
//if(str.length==0)
//{breakLines.addElement("");
// return breakLines;
//}
//int currentIndex=0;
FontMetrics fms=frm;
while(str.current()!=StringCharacterIterator.DONE)
{
int textWidth=0;
StringBuffer bf=new StringBuffer("");
bf.append(str.current());
textWidth+=fms.charWidth(str.current());
while(str.next()!=StringCharacterIterator.DONE
&& (textWidth+=fms.charWidth(str.current()))
{
bf.append(str.current());
if(str.current() ==' ')
{
break;
}
}//while
breakLines.add(bf.toString());
}
return breakLines;
}
//我是这样
//有些字体不支持 杂办