Spell Catcher X 10.3’s Developer Tools

Spell Catcher X 10.3’s DirectCorrect™ feature has some additional tools that developers might find useful when implementing/testing certain aspects of their text input (TSM or NSTextInput) and text-related accessibility support. I certainly did…

These tools are enabled by entering the following into the Terminal:

defaults write com.rainmaker.SpellCatcher SCSpellCatcherDeveloperMode -bool TRUE

You’ll need to Quit the Spell Catcher app first. If a Spell Catcher input mode is or has been active since you last logged in, you will need to Quit the Spell Catcher UI Server background app as well. Just use Activity Monitor to Quit it manually (no need to force quit).

And On With The Show

DirectCorrect Developer Controls (Click images to enlarge)

Download our sample document.

After enabling developer mode, the DirectCorrect inspector will contain some additional controls at the bottom of the window.

Developer Controls

The function of most of the Developer controls should be pretty obvious to developers.

Draw word bounds

DirectCorrect Word BoundsSelect to draw the bounds for each highlighted word.

The basic bounding rectangle is drawn in blue, the ascent line in green, and the cyan "dots" are drawn as 4-pixel rectangles centered on kEventParamTextInputReplyPoint for the first and last characters of the word.

More informative help tags

DirectCorrect Help TagsHelp tags with more information, including the values used to compute the bounds, are available for each highlighted word.

Get all positioning information

Select to always retrieve all available positioning information - TSM OffsetToPos, TSM Rects (Leopard only), and AX Bounds. This shows the maximum amount of positioning information in help tags for highlighted words.

Get all text attributes

Select to always retrieve all available font information - TSM DocAccess, AX Attributes, and RTF. This shows the maximum amount of attribute information in help tags for highlighted words.

Highlight every word

DirectCorrect Highlight Every WordCan't be bothered introducing errors into the document you're testing with just so they're highlighted? Select this and every word will be.

Totally Obsolete Cocoa Source Code

If you’d like your NSTextFields and textual NSTableColumns to draw just like the Finder and other Carbon apps do, squishing the text or truncating it in the middle, this is for you!

This implements a category method on NSCell that you can call from your NSTextFieldCell subclass’ -drawInteriorWithFrame override.

Download NSCell-Extensions.m, it's heavily commented.

More information is available at CocoaDev. See BetterTruncatingStringsInTableView

Updated Oct 27, 2003 to work-around a bug in ATSUI on OS X 10.3.