Copyright 2004 by M. Uli Kusterer Tue, 30 Dec 1969 07:58:58 GMT Comments on article blog-cocoa-text-system-everywhere at Zathras.de http://www.zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm blog-cocoa-text-system-everywhere Comments witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) en-us Comment 3 by Matt http://www.zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm#comment3 http://www.zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm#comment3 Matt writes:
Great article! Exactly what I was looking for. Thanks!
Comment 2 by Uli Kusterer http://www.zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm#comment2 http://www.zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm#comment2 Uli Kusterer writes:
@Michael: Thank you, you're right, I converted some CG-using code that actually used CGSizeMake() and forgot the different naming. And you're right, FLT_MAX was what I was looking for. Couldn't initially find it as it neither came up in a search for 'float', nor was in limits.h... Thanks.
Comment 1 by Michael Nickerson http://www.zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm#comment1 http://www.zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm#comment1 Michael Nickerson writes:
Hey Uli, small typo in your code to resize the text container - that should be NSMakeSize() not NSSizeMake() (been playing around with CG stuff lately?).

Also, NSMakeSize() takes float arguments, so that should probably be FLT_MAX, not LONG_MAX.

And an interesting bug for everyone - if you don't put together the text system like above, you'll leak a little memory. i.e. if you add the layout manager to the text storage, *then* add the text container to the layout manager. I keep forgetting to submit a bug about that one.