Re: string drawing again
Re: string drawing again
- Subject: Re: string drawing again
- From: David Elliott <email@hidden>
- Date: Sat, 7 Feb 2004 22:37:22 -0500
On Feb 4, 2004, at 6:30 PM, Chris Meyer wrote:
I'm trying to draw a string in a sub-rectangle of a non-flipped
graphics context. The string needs to be justified to the sides of the
sub-rectangle.
I can't use the NSString methods drawInRect or drawAtPoint because
they clip the right side of large italicized strings.
I can't use the text layout classes because they (strangely) require a
flipped coordinate system.
I've had great luck in wxCocoa using them on non-flipped windows. The
trick is that you have to manually adjust some things because the text
system seems to account for flipped views in some places but not
others.
Check this out:
http://cvs.wxwindows.org/viewcvs.cgi/wxWindows/src/cocoa/dc.mm?
rev=1.19&content-type=text/vnd.viewcvs-markup
Specifically, wxDC::DoDrawText()
Note, this was written quite a long time ago now and with almost zero
knowledge of the Cocoa text system aside from reading the documentation
and pure trial and error.
In hindsight, it probably would have been easier to keep an NSTextView
around in an offscreen window and composite the drawing onto the real
view.
-Dave
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.