Newlines + quartz text?
Newlines + quartz text?
- Subject: Newlines + quartz text?
- From: "Maryanna Rogers" <email@hidden>
- Date: Sat, 4 Aug 2007 22:05:40 -0400
Hi,
I've been struggling with trying to figure out how to have Quartz
display newline characters as actual line breaks.
NSString* newScript = [[NSString alloc] initWithString:@""];
NSString *sep = [NSString stringWithFormat: @"%C", NSLineSeparatorCharacter];
NSString* rCont = [[NSString alloc] initWithContentsOfFile:rootPath
encoding: NSUnicodeStringEncoding error:&error];
NSArray *lines = [rCont componentsSeparatedByString:@"\n"];
for(NSString *line in lines) {
newScript = [newScript stringByAppendingString:line];
newScript = [newScript stringByAppendingString:@"\n"];
}
NSLog(@"new script %@", newScript);
CGContextShowTextAtPoint (myOverlayContext, 0, 0, [newScript
cStringUsingEncoding: NSUnicodeStringEncoding g], [newScript length]);
I've tried all sorts of different encodings, ASCII, unicode, UTF8, and
none work Little rectangles are displayed where the breaks should be.
Can someone help me figure out why the text I draw through
CGContextShowTextAtPoint keeps refusing to break when I give it a
newline? I don't understand!
~m
_______________________________________________
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