Drawing Chinese text to PDF
Drawing Chinese text to PDF
- Subject: Drawing Chinese text to PDF
- From: Stevo Brock <email@hidden>
- Date: Thu, 11 Aug 2011 10:57:02 -0700
Hi All,
We have an existing PDF Report creation module in one of our apps that is working great... for English text. This is what we are doing:
NSFont* font = [NSFont fontWithName:@"Helvetica" size:12.0];
CGContextSelectFont(state->mContextRef, [[font fontName] UTF8String], [font pointSize], kCGEncodingMacRoman);
NSData* data = [string dataUsingEncoding:NSMacOSRomanStringEncoding];
CGContextShowTextAtPoint(state->mContextRef, drawPt.x, drawPt.y, (char*) data.bytes, data.length);
We have a user who is entering Chinese text, which is obviously not making it to the PDF through this mechanism.
What is the recommended approach for taking an NSString* of text and drawing it to a CGContextRef where the text may contain characters of any language?
-Stevo Brock
Head of Development
Monkey Tools, LLC
www.monkey-tools.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden