• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Drawing Chinese text to PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Drawing Chinese text to PDF
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: Strange window behavior
  • Next by Date: Re: Saving a rotated image
  • Previous by thread: Re: Strange window behavior
  • Next by thread: Re: Drawing Chinese text to PDF
  • Index(es):
    • Date
    • Thread