Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site ut-ngp.UTEXAS
Path: utzoo!linus!philabs!cmcl2!seismo!ut-sally!ut-ngp!awd
From: awd@ut-ngp.UTEXAS (Andrew W. Donoho)
Newsgroups: net.micro.mac
Subject: Re: Rotating "fonts" on the LaserWriter
Message-ID: <2575@ut-ngp.UTEXAS>
Date: Fri, 8-Nov-85 18:05:15 EST
Article-I.D.: ut-ngp.2575
Posted: Fri Nov  8 18:05:15 1985
Date-Received: Sun, 10-Nov-85 16:53:05 EST
References: <294@mhuxl.UUCP>
Organization: UTexas Computation Center, Austin, Texas
Lines: 51

The May 1985 Software Supplement includes a document called,
"Optimizing Code for the LaserWriter."  Along with a lot of other
juicy information about the Macintosh LaserWriter driver, there is a
section called, "QuickDraw Comments for Text Rotation/Justification
and Polygons."  This section containts a complete description of how
to rotate text using the LaserWriter.  Here is some of what is described
there:

Using the PicComment routine to add comments to a picture, an
application can take advantage of features that a printer might have
which are not directly available in QuickDraw, such as rotated text.

CommentType	#	data size	data		description
TextBegin	150	6 bytes		TTxtPicRec	Begin special text
TextEnd		151	none		none		End special text
TextCenter	154	8 bytes		TTxtCenter	Offset for rotation

where TTxtPicRec and TTxtCenter are Pascal records as follows:

TTxtPicRec =	PACKED RECORD
		  tJus: Byte;		{0,1,2,3,4:none,left,center,right,fill)
		  tFlip: Byte;		{0,1,2:none,horizontal,vertical}
		  tRot: Integer;	{0..360:degrees of rotation}
		  tRes: Integer;	{"reserved"}
		END;

TTxtCenter =	PACKED RECORD
		  yInt: Integer;	{Integer part of y offset to center}
		  yFract: Integer;	{Fractional part of y offset to center}
		  xInt: Integer;	{Integer part of x offset to center}
		  xFract: Integer;	{Fractional part of x offset to center}
		END;

Then you can call like this to justify and/or flip text:

PicComment(150,6,@TxtPicRec);		{set justifying}
  DrawString('This text will be justified and flipped.');
PicComment(151,0,NIL);			{end the special effects}

To rotate text, try something like this:

PicComment(150,6,@TxtPicRec);		{set rotating}
PicCommment(154,8,@TxtCenter);		{specify center of rotation}
  DrawString('This text will be rotated.');
PicComment(151,0,NIL);			{end the special effects}

If you want to do any more than these few minimum things, try reading
the Apple document, it is very useful for anyone using the
LaserWriter.

Darin Adler