[comp.windows.x] vertical text

tima@bcs800.UUCP (Tim Addington) (12/04/90)

I realize that this belongs in comp.windows.x.questions_from_clueless_veggies,
but, here goes anyway...

What I want to do is to print text in orentations other than horizontal.
Vertical would be acceptable but, printing at various angles would be even
better.

How does one go about doing this?  After searching through thousands of
pages of various FMs, I did not find any examples.

Any help would be appreciated.

mouse@LARRY.MCRCIM.MCGILL.EDU (12/05/90)

[Sorry everybody for posting something just snatched from the FAQ, but
the post I'm replying to didn't include an email address...]

> What I want to do is to print text in orentations other than
> horizontal.  Vertical would be acceptable but, printing at various
> angles would be even better.

> How does one go about doing this?

--------------------------------------------------
Subject: 69)+ How do I render rotated text?
	
	Xlib intentionally does not provide such sophisticated graphics 
capabilities, leaving them up to server-extensions or clients-side graphics
libraries.
	Your only choice, if you want to stay within the core X protocol, is to
render the text into a pixmap, read it back via XGetImage(), rotate it "by hand"
with whatever matrices you want, and put it back to the server via XPutImage();
more specifically:
	1) create a bitmap B and write your text to it.
	2) create an XYBitmap image I from B (via XGetImage).
	3) create an XYBitmap Image I2 big enough to handle the transformation.
	4) for each x,y in I2, I2(x,y) = I(a,b) where 
		a = x * cos(theta) - y * sin(theta)
		b = x * sin(theta) + y * cos(theta)
	5) render I2
	The high-level server-extensions and graphics packages available for X 
also permit rendering of rotated text: Display PostScript, PEX, PHIGS, and GKS,
although most are not capable of arbitrary rotation and probably do not use the
same fonts that would be found on a printer.
	In addition, if you have enough access to the server to install a font
on it, you can create a font which consists of letters rotated at some
predefined angle. Your application can then itself figure out placement of each
glyph.

[courtesy der Mouse (mouse@larry.mcrcim.mcgill.edu), Eric Taylor 
(etaylor@wilkins.bmc.tmc.edu), and Ken Lee (klee@wsl.dec.com), 11/90]

--------------------------------------------------

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

fgreco@dprg-330.GOVt.shearson.COM (Frank Greco) (12/11/90)

> What I want to do is to print text in orentations other than horizontal.
> Vertical would be acceptable but, printing at various angles would be even
> better.
> 
> How does one go about doing this?  After searching through thousands of
> pages of various FMs, I did not find any examples.
> 
> Any help would be appreciated.

	If you're using Sun's and OpenWindows, you could render Postscript
	(actually NeWS) in an XView Canvas and rotate any of the (OW)
	standard outline (F3) fonts at any angle you want (this is also 
	true of vanilla X and Adobe's product Display Postscript).
	This is quite simple.  
	
	For good ole X, I'm afraid you'll have to perform geometric transforms 
	yourself (massage the bits according to the standard transformation recipe
	into an off-screen pixmap then bit-blast 'em to the screen).


	Frank G.