| 40 | private final int[] id = new int[5]; |
| 41 | |
| 42 | public TextUtil(int style, int textSize, |
| 43 | int paint_flags, boolean monospace) { |
| 44 | Typeface tf = Typeface.create(monospace |
| 45 | ? Typeface.MONOSPACE |
| 46 | : Typeface.DEFAULT, |
| 47 | style); |
| 48 | |
| 49 | paint = new Paint(paint_flags); |
| 50 | paint.setTypeface(tf); |
| 51 | paint.setTextSize(textSize); |
| 52 | if ((style & Typeface.ITALIC) != 0 && !tf.isItalic()) |
| 53 | paint.setTextSkewX((float) -0.2); |
| 54 | |
| 55 | metrics = paint.getFontMetricsInt(); |
| 56 | } |
| 57 | |
| 58 | public void getFontMetrics(int[] metrics) { |
| 59 | Rect bounds = new Rect(); |