Well it seems sort of a bug of Paint.measureText()
or other deeper class. But I have FINALLY found a way around it:
layout.getPrimaryHorizontal(int offset)
This is very easy. You just iterate through the layout using the length of the text it uses.
It will return the the x of the Character REGARDLESS of line position. So lines I'm still getting from the layout.getLineTop()
. By the way, if you are using the layout.getLineTop()
, note that there is some strange behaviour, possibly a bug. I have submitted a bug report here.