[comp.windows.x] Text Direction

amir@taux01.nsc.com (Amir J. Katz (Xpert)) (05/16/91)

I fuzzily recall seeing something about font direction (right-to-left or
left-to-right) in some .bdf files. The BDF.PS document in X11R4/hardcopy/BDF
does not mention it.

1. Is there such a property for a font?
2. If so, does anyone use it?

And the clinchers:
3. Is it possible to write text in a direction other than left-to-right?
4. If not, how does Kanji X work?

Please e-mail to me and I'll summarize if there is anough interest.
--
   Amir J. Katz, System Manager

Internet:	amir%pilat.UUCP@taux01.nsc.com
UUCP:		{decwrl,uunet,...}!nsc!taux01!amir
Phone:		+972 52-570713
Fax:		+972 52-570719
Snail-mail:	Amir J. Katz, Silvaco Israel Ltd.
		19 Maskit St., Herzelia, Israel 46733

mouse@lightning.mcrcim.mcgill.EDU (der Mouse) (05/17/91)

> I fuzzily recall seeing something about font direction (right-to-left
> or left-to-right) in some .bdf files.  The BDF.PS document in
> X11R4/hardcopy/BDF does not mention it.

> 1. Is there such a property for a font?

Yes.  The XFontStruct you get back from XQueryFont and related
functions contains a `direction' member which is described as

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.

I have not looked at the code to determine where this comes from in the
chain from BDF file to XFontStruct (via bdftosnf and the server).

> 2. If so, does anyone use it?

I know of no programs that use it, though one I am planning to write
(someday!) will.

> And the clinchers:

> 3. Is it possible to write text in a direction other than
>    left-to-right?

If the font contains characters with negative width values, writing
them produces right-to-left text.  Non-horizontal text is not directly
supported; you have to deal with figuring out glyph placement yourself.

> 4. If not, how does Kanji X work?

I have seen Japanese and Chinese written left-to-right horizontally,
with lines top-to-bottom, in the English fashion, so it is not an
utterly unheard-of thing.

Of course, I daresay proper top-to-bottom columns ordered
right-to-left[%] would be preferable, but not being anything close to
fluent in either language I am only guessing.

[%] R-to-L for Japanese, unless my memory has gotten confused since
    that Japanese course I took; I have no reason for thinking R-to-L
    is appropriate for Chinese except a presumption based on its
    writing system being related to that of Japanese.

					der Mouse

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