Re: Text display consistency
Re: Text display consistency
- Subject: Re: Text display consistency
- From: Matt Neuburg <email@hidden>
- Date: Wed, 22 Dec 2010 10:52:24 -0800
On Tue, 21 Dec 2010 12:52:02 +0000 (GMT), Kenneth Baxter <email@hidden> said:
>Hi, I have an application that needs to display text on both Mac OS X and on iOS. I'm sticking to core technologies for my drawing and drawing all my stuff into cgcontexts for maximum portability.
>
>I sometimes need the user to edit the text, so am planning to add a subview (NSTextView / UITextView) when the user needs to edit the text.
>
>What is the best way to minimize the customization for the two versions of the application, and ensure that when I put the text view over the top, that it is exactly the same size and shape (kerning/wrapping etc) when drawn in the text view and when drawn directly in the cg context?
>
>Any gotcha's I should know about?
>
The whole thing is a gotcha. On iOS, at least, the technology that draws a UITextView is different from the lower-level drawing technology, e.g. Core Text. (A tiny obscure hint in the documentation, along with some other clues, leads to me suspect that a UITextView is drawn with WebKit.) So the chances of your getting a physical match is pretty well nil. In my view the entire goal of cross-platform code compatibility (Mac OS X <-> iOS) is pretty well forlorn, and I'd recommend just using higher-level mechanisms on both and dealing with the doubled code base. m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings_______________________________________________
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