Вопрос

I use Nexus 7 device

I create Paint with font size and type face; My font is "Arial", size is 780; My task is to write "sit" with different colours (s - in red, it - in blue)

for(int j = 0; j < subStr.get_items().size(); j++) // substr contains two elements "s" and "it"
{
    TextWord item = subStr.get_items().get(j);
    paint.setColor(item.get_textColor());
    paint.setAntiAlias(true);
    canvas.drawText(item._value, item._textRect.left, item._textRect.top + item._textRect.height(), paint);
}

In application I see only "s t", but "i" is not visible. What could be problem? BAD DRAWING - https://dl.dropboxusercontent.com/u/35170194/Screenshot_2013-05-07-18-22-48.png GOOD DRAWING - https://dl.dropboxusercontent.com/u/35170194/Screenshot_2013-05-07-18-22-37.png

Это было полезно?

Решение

If _textRect is calculated with same font size, try to reduce font size used for drawing actual text(e.g. to 5-10%).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top