Search code examples
androidcanvasdrawtext

Can I draw pi on an android canvas to look like it was drawn with drawText?


Hi I have an android canvas that I draw text on with a shadow layer and some other text effects. I would like to be able to also draw π onto the canvas to look the same as drawText, but I dont think drawText supports UTF-8 so this is where I am stuck. Does anyone know some other way I can accomplish this? Making my own paths to display would work but I do not know how to make a nice looking pi path. Thanks for any answers!


Solution

  • Base on android documentation about String

    A String is represented by array of UTF-16 values, such that Unicode supplementary characters (code points) are stored/encoded as surrogate pairs via Unicode code units (char).

    Therefore, you can draw any unicode text in Canvas.