Android Question MeasureStringWidth not working well

Cesaral

Member
I am using an Android Canvas and the function MeasureStringWidth to measure the text drawn in the canvas by the DrawText function. I have tested it with several TT fonts and font sizes, with the same bad results.

The value given by MeasureStringWidth is a bit longer that the value of pixels of the final picture that I analyse with photoshop`.

For example I use Arial font with a fon´t size of 50, and print the word "first". The MeasureStringWidth gives me a value of 274 but I access the PNG file that I generate from the canvas, and I can count just 218 pixels.

Any ideas?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…