(Canvas canvas, String text, ParagraphStyle ps, float width)
| 14 | } |
| 15 | |
| 16 | public void drawLine(Canvas canvas, String text, ParagraphStyle ps, float width) { |
| 17 | try (ParagraphBuilder pb = new ParagraphBuilder(ps, fc);) |
| 18 | { |
| 19 | pb.addText(text); |
| 20 | try (Paragraph p = pb.build();) { |
| 21 | p.layout(Math.min(200, width)); |
| 22 | p.paint(canvas, 0, 0); |
| 23 | canvas.translate(0, p.getHeight()); |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | @Override |
| 29 | public void draw(Canvas canvas, int width, int height, float dpi, int xpos, int ypos) { |