[comp.sys.mac.programmer] Vertical Text

oster@dewey.soe.berkeley.edu (David Phillip Oster) (12/21/88)

A few months ago, MacTutor magazine ran an article with complete source
code on how to do this. Here is what it does:

use textedit, but with the grafPort redirected to an offscreen bitmap.
After each keystroke, copybits the offscreen bitmap, with a transform , to
the screen.

The transforms in the artcile were pretty nifty. Each keystroke was echoed
1.) right side up
2.) upsise down
3.) flipped left to right
4.) flipped and upside down.

Quite a trip!

The article included the code for a fast 90 degree rotater.

The rotater worked as follows:

think of your bitmap as an array of 8x8 bit cells, for example,

a b c d
e f g h
i j k l

to rotate the bitmap, copy and transpose, so the destination sees the
cells:

d h l
c g k
b f j
a e i

As you move each cell, run it through a tuned assembly language routine
that does basically the same transpose, but at the bit level, not the
cell level.

The article also goes into taking care of the boundary conditions so you
can rotate any bitmap, not just those with dimensions that are a multiple
of 8.

Great article!

--- David Phillip Oster            --"When we replace the mouse with a pen,
Arpa: oster@dewey.soe.berkeley.edu --3 button mouse fans will need saxophone
Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --lessons." - Gasee