The Paint class has some methods for this. Example: http://developer.android.com/intl/zh-CN/reference/android/graphics/Paint.html#getTextBounds%28java.lang.String,%20int,%20int,%20android.graphics.Rect%29
On Dec 7, 11:42 am, Alessandro Pellizzari <[email protected]> wrote: > Hi all, > > given a style (font, size, bold/italic, etc), is there a way to > calculate how many (horizontal) pixels a text will take when printed on > a Canvas, without actually printing it? > > Thank you very much. > Bye. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

