I am drawing an image using CoreGraphics and can't get the €-sign displaying correctly..
The dollar sign works fine, however. I have tried it using different fonts but same problem, my guess now is that there is an encoding problem of some sort, but I still cant get it working correctly.
Here is my code that does the drawing:
context.SelectFont (font.FamilyName, font.PointSize, CGTextEncoding.MacRoman);
context.SetFillColorWithColor (color.CGColor);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.SetShouldAntialias (antiAlias);
context.ShowTextAtPoint (position.X, position.Y,text);
Anything that can point me in the right direction is appreci开发者_StackOverflowated.
The "euro" sign is a bit more recent than other characters but, even if defined in MacRoman, I could not get CoreGraphics to display it properly with ShowTextAtPoint (I suspect an encoding issue).
However it works fine if you use UIKit instead of CoreGraphics, see Q&A: no german umlaute in CGBitmapContext for the sample code.
精彩评论