From: Kevin W. <kw...@co...> - 2012-11-28 16:07:28
|
Hi list, On 11/26/12 4:31 PM, Russell E. Owen wrote: > > Would it be OK to change Tcl/Tk so that the width option on these > widgets actually does specify roughly how many chars could be displayed? > Its a simple change, though admittedly one that requires a Mac-specific > branch. I guess an obvious question is how widely others are already > hacking around this issue. (I assume most users use width=0 and thus > don't see this bug). I would appreciate others weighing in on this. As I've commented to Russell at the bug report, my view is that what he's seeing is not a bug but simply the platform-specific implementation, i.e. Cocoa may simply calculate text width and render it a bit differently than did Carbon. (Carbon used QuickDraw and then ATSUI for its text rendering, while Cocoa uses CoreText.) If he does not use hard-coded widths then the text displays fine, although it may change the layout of his app. My understanding is that it's not considered a best practice in Tk to hard-code text widths and font sizes, because font rendering can vary so widely across platforms: what looks good on one platform may look quite different (and not so good) on another. My limited experience with deploying a Tk app on Windows confirms this. I'm reluctant to go against the platform-specific grain and investigate a change that would preserve cross-platform compatibility at the expense of best practices on the specific platform, cf. how other Cocoa-based apps do it. I'm especially reluctant to do so (and not even sure it can be done) given that Russell has found a workaround for his use case. Other opinions are welcome. Thanks, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com |