[MonoDevelop] UTF-16 support?
Michael Hutchinson
m.j.hutchinson at gmail.com
Wed Mar 28 20:12:54 UTC 2012
On 26 March 2012 19:21, Megan Clodfelter <megan.clodfelter at gmail.com> wrote:
> Michael -
>
> Many thanks for your reply, unfortunately, I am still having issues. I
> changed the font display for the entire project to a UTF-16 font
> (AppleGothic) and my characters appeared just fine.
>
> So far so good. Now, the next step was to display my characters on the
> iPad. I verified that AppleGothic is a standard iPad font. My objective is
> to overlay my UTF-16 characters onto an image. I create the UIGraphics
> context, perform a "SelectFont" using "AppleGothic", a point size and with
> CGTextEncoding set to "FontSpecific" I see nothing. Obviously, my
> characters exist in that font, as I can now see them in the code window.
> When I change the encoding to the incorrect "MacRoman", I see little boxes
> where my characters should be.
>
> What do I need to do to ensure that UTF-16 characters are displayed as part
> of a UIGraphics object?
I'm not familair with MonoTouch Text rendering, but I found some
StackOverflow posts that seem to indicate that CGContext has no
support for anything other than ASCII/MacRoman text, and that you
should use CoreText or UIView.DrawString:
http://stackoverflow.com/questions/7190005/iphone-using-cgcontextshowtextatpoint-to-draw-special-characters
http://stackoverflow.com/questions/1564577/converting-a-nsstring-to-a-cstring-for-use-with-cgcontextshowtextatpoint
http://stackoverflow.com/questions/7672453/custom-font-does-not-render-correctly-when-using-showtext
http://stackoverflow.com/questions/275437/unicode-character-not-showing
I've cc'd the message to the MonoTouch list, maybe someone there can
help with this.
--
Michael Hutchinson
http://mjhutchinson.com
More information about the Monodevelop-list
mailing list