[NTLK] Notepad that isn't for NOS

Warren Ockrassa wockrassa at gmail.com
Sat Dec 3 23:57:10 EST 2011


On Sat, Dec 3, 2011 at 1:48 PM, Joseph Reilly <Reilly001os at aol.com> wrote:

> Never seen the "typewriter" functionality you mentioned on a newton.

After consulting the script and programming references, it looks
feasible. Setting the scroll position on a view can be done, so
rolling up text is possible. There is a system message that's sent
when ink has been recognized and converted to text. Caret positioning
can be handled programmatically as well, both setting it and reading
its placement on the screen. I'd want to do that, I think, to prevent
a stray tap from being interpreted to mean 'place the caret here' -
though that raises the spectre of modality, suggesting there'd have to
be a toggle between text-input and free edit mode.

Of course, if I'm going to do that, it would be as sensible to do
something like what the 'WriteHere' package does, and create a view
that's used exclusively for inputting text, with the interpreted
results being placed in a different view entirely. 'WriteHere'
actually does at least some of what I want, but it's got more
functions than I need, and it's a bit on the slow side, I think.

Basically the pseudocode is:

Wait for a system message that text has been recognized
Look at the caret position
Adjust the view so the caret is approximately at the middle of the
screen and setting the top of the text view so its y-axis shifts the
bottom of the text to the caret's point (or possibly the reverse, but
I think the idea is sound)

The line heights for the text seem to be roughly point size + 2, so
12-point type has a line height of 14 pixels. Thus 20 lines of
12-point text are about 280 pixels high. That means, on a portrait
view, the origin of the text would be set at about -40 on the y-axis
to get its last line located near the middle of the view, leaving the
bottom half blank for more writing. If you then add three more lines
of text, the y-axis origin would be adjusted to -82, leaving, again,
half the screen for writing.

You can even set up tab stops, and override per-selection fonts - that
is, set the font in a view so it affects all text, not just the stuff
that's selected. Why would I want to do that? Convenience and
viewability. As far as I'm concerned, the only font styles I'll want
to preserve are italic, bold, and underline. The typeface is
irrelevant, since the Newton package would be a raw text input
platform, with a desktop machine being used to do the heavy lifting on
formatting. Paramount importance will be given to legibility.

For the background I'd probably do away with the lines entirely.
They're an unnecessary reference to a real-world object (lined paper)
that doesn't map to a digital input medium, and wherever they
intersect letterforms they decrease legibility. Put another way, I see
them as an awkward and inefficient crutch.

A nice bonus is that the package can still rely on the system scroll
arrows for manual scrolling. There's no need to eat screen real estate
for custom scroll controls.

-- 
-- Warren Ockrassa | nightwares.com



More information about the NewtonTalk mailing list