Yes, this works.

Here is the test case. (http://videlaisstudios.info/testing/pixi/text/) And here is a screenshot running under CocoonJS I took earlier today. (https://twitter.com/Videlais/status/445120584213487616/photo/1)

The specification says to default to 300x150. Those are the default values for width and height for a Canvas element accordingly.

However, it is true that this function makes the assumption that the drawn 'gM' will be smaller than 300x150. I'm not sure how to get around that. Maybe make the created canvas some arbitrarily large size?