DrawPosText () in android.graphics.Canvas, what is the beginning?

drawPosText (char [] text, index int, int count, float [] pos, Paint paint) Draw text in an array, each character specified . pos.

Does anyone know exactly where drawPosText considers "origin" as you specify "origin" as coordinate pairs; that is, this is the bottom left symbol, center, what?

Just like drawPosText calculates the height of a character when it draws?

+3
source share
1 answer

Ah, I spent a piece yesterday, playing with centering some text!

, . , , - .

Math.abs(p.ascent()) + p.descent()

p - Paint.

+6

Source: https://habr.com/ru/post/1737009/


All Articles