SurFaceView内でテキストのサイズが一定以上オーバーした際に、
オーバーした分を削除し末尾に…を貼付ける様にしたいのですが、
下だと高確率でエラーが出ます。安定した方法ってないですか?

if( TextSize >= MainActivity.disp.getWidth()/2 ){
while( x > MaunActivity.disp.getWidth()/2){
StringBuffer sb = new StringBuffer(_text);
x = sb.length()-1;
sb.deleteCharAt(x);
_text = sb.toString();
float textWidth = paint.measureText(_text);
int textCounter = (int)textWidth;
int textSize = Math.abs(textCounter);
x = textSize;
}
StringBuffer sb = new StringBuffer(_text);
x = sb.length();
sb.insert(x, "…");
_text = sb.toString();
}
}