Friday, August 24, 2012

How to resolve IPhone 3 HTML5 canvas fillText not working

I am writing a HTML5 canvas applications which has some text in it to be written by the fillText command. This worked well in Safari, Firefox, Ipad but would not work in Iphone 3. Then I found the solution in this discussion:

iPhone/iPad HTML5 Canvas fillText problem.

Downloaded  strokeText.js and implemented with success as per instructions given in the downloaded document. It works now in Iphone 3 along with Safari, Firefox, Opera and even IE9!

HTML

<script src="js/strokeText.js" type="text/javascript"></script>


Javascript



set_textRenderContext(context);

if (check_textRenderContext(context)) {
context.strokeText(text, text_xoffset, text_yoffset, font_size);
}

No comments:

Post a Comment