Re: Line spacing in NSTextView

2009-02-14 Thread Slava Pestov
Is there a way to compute what the default leading would be for a font? This is for a Mac OS backend of a cross-platform GUI toolkit, so I can't really just use NSTextView here. Slava On Fri, Feb 13, 2009 at 9:16 PM, Graham Cox graham@bigpond.com wrote: Line spacing (or to be more precise,

Re: Line spacing in NSTextView

2009-02-14 Thread Slava Pestov
On Sat, Feb 14, 2009 at 9:58 PM, Aki Inoue a...@apple.com wrote: The Text System encapsulates the logic to determine the ideal layout. It's not just queried from a font instance. It requires the context of an entire line. What if the line is rendered with a single font? Which font attributes

Re: Line spacing in NSTextView

2009-02-14 Thread Slava Pestov
On Sun, Feb 15, 2009 at 12:26 AM, Aki Inoue a...@apple.com wrote: The most simple logic for getting the default line height can be accessible via -[NSLayoutManager defaultLineHeightForFont:]. AppKit puts descent + leading below the baseline, so you should be able to calculate the line spacing

Line spacing in NSTextView

2009-02-13 Thread Slava Pestov
Hi all, Can someone enlighten me, how does NSTextView compute line spacing? When I display a piece of text in stickies, with Helvetica 12 (or any other font, really), and the same piece of text in my application, stickies adds another 2 pixels of spacing between every line, and the result looks

Sub-pixel font smoothing with CGBitmapContext

2009-01-28 Thread Slava Pestov
Hi all, When I render text into a CGBitmapContext that has been filled with a solid color, sub-pixel font smoothing is not applied and text looks suboptimal compared to text rendered elsewhere. How can I enable font smoothing? Calling CGContextSetShouldSmoothFonts doesn't seem to help. Slava

A question about key equivalents for menu items

2009-01-26 Thread Slava Pestov
Hi all, Is there a nice way to get a Unicode string from a keyboard shortcut, that looks like the key equivalents in NSMenuItems, for rendering elsewhere in a GUI? Slava ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: How to catch and log EXC_BAD_ACCESS?

2009-01-26 Thread Slava Pestov
On Mon, Jan 26, 2009 at 10:43 PM, Michael Ash michael@gmail.com wrote: Actually it's pretty easy to avoid exiting due to EXC_BAD_ACCESS, just install a signal handler for SIGSEGV. In my experience, setting a handler for SIGSEGV is problematic because the crash reporter still starts up, so

Re: Questions about [NSApplication run]

2008-12-05 Thread Slava Pestov
Hi, The reason I'm doing it is because I have a Cocoa binding for Factor (http://factocode.org), and the Factor VM doesn't support native threads. The language has its own lightweight co-operative thread model, with all I/O done non-blocking under the hood, to give the illusion of concurrency; a

Re: Questions about [NSApplication run]

2008-12-05 Thread Slava Pestov
On Fri, Dec 5, 2008 at 10:41 PM, Ken Thomases [EMAIL PROTECTED] wrote: If you can require Leopard, take a look at CFFileDescriptor. Prior to Leopard, you can use CFSocket with any file descriptor, so long as you don't use the socket-specific parts of that interface. I do indeed require