Hey, I am creating a Live Wallpaper that includes text that is drawn directly on the canvas through the TextPaint object and DynamicLayout. In my DynamicLayout object, I set the width of the canvas, and now I'm looking for a way to wrap text that passes by the canvas. Here is my text code:
TextPaint tp = new TextPaint();
Layout sl = new DynamicLayout(token, tp, (int) canvasWidth, Layout.Alignment.ALIGN_NORMAL, 0, 0, true);
canvas.translate(startPositionX , startPositionY);
sl.draw(canvas);
How to wrap this text if it passes by canvasWidth? Any help is appreciated!
source
share