I draw formatted text on canvas using DynamicLayout, and I need to implement some kind of scaling. I tried using canvas.scale(...)for this. But when the text contains glare, the text is scaled incompatible with the background, for example:

The code that draws the text is very simple:
canvas.scale(zoom, zoom);
TextPaint textPaint = new TextPaint();
textPaint.setAntiAlias(true);
DynamicLayout layout = new DynamicLayout(text, textPaint, width,
Layout.Alignment.ALIGN_NORMAL, 1.0f, 1.0f, false);
layout.draw(canvas);
How to make the right way?
source
share