[comp.windows.x] Font draw direction

doleh@mcs.kent.edu (Yaser Doleh) (03/28/91)

What is the perpose of draw direction field in the font structure ?
How do you create a font with a draw direction RightToLeft ?
If a font have a draw direction RightToLeft, is DrawString going
to the the string from right to left ?

Thank you.
-- 
---------------------------------------------------
Yaser Doleh   <doleh@mcs.kent.edu>
Department Of Mathematics & Computer Science
Kent State University
Kent - OH 44242

mouse@lightning.mcrcim.mcgill.EDU (der Mouse) (03/28/91)

> What is the perpose of draw direction field in the font structure ?

Quoting from the Xlib manual,

	The members of the XFontStruct have the following semantics:
	
	o    The direction member can be either FontLeftToRight or
	     FontRightToLeft.  It is just a hint as to whether most
	     XCharStruct elements have a positive (FontLeftToRight) or
	     a negative (FontRightToLeft) character width metric.  The
	     core protocol defines no support for vertical text.

> How do you create a font with a draw direction RightToLeft ?

I don't know, offhand; presumably something in the BDF file turns into
the direction hint by the time it gets into the server.

> If a font have a draw direction RightToLeft, is DrawString going to
> the the string from right to left ?

Probably, but not because of the direction value; rather, XDrawString
will simply add the character widths, which for a right-to-left font
will normally mean that each glyph is drawn to the left of the previous
one, because most widths will be negative.

					der Mouse

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