[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] I'd like a \X'...' stuff to write mirror-characters

From: Ted Harding
Subject: RE: [Groff] I'd like a \X'...' stuff to write mirror-characters
Date: Wed, 23 Aug 2000 15:08:15 +0100 (BST)

On 22-Aug-00 baruchel wrote:
> Brest, le mardi 22 août
> Hi, I need to print the mirror image of a symbol (a character in a
> font). I tried \X'180 rotate' as a first step (it isn't anyway what I
> exactly want). I was surprised to discover that it doesn't work.
> Is there a way to print characters with a rotation or a symetry ?

This sort of thing is more subtle and complicated than one might expect.
(By the way, even if your idea did work, you would have to put in the
"ps: exec" as well: \X'ps: exec 180 rotate').

The following is code which I use for the Azeri "upside-down e" character:

.\" Azeri upside-down e and E
.ds eupsidedown "\h'\w'e'u'\v'-0.45m'\X'ps: exec gsave currentpoint \
2 copy translate -180.0000 rotate neg exch neg exch \
translate'e\X'ps: exec grestore'\h'-\w'e'u'\v'0.45m'
.char \(eu \*[eupsidedown]
.char \(EU \s+'\\n[.ps]/2'\(eu\s0

\(EU is it's "upper-case" version. Note that the "rotate" command here
literally rotates the character in the plane of the page: it does not
reflect it in a vertical axis which is what you seem to want to do. (But
if it is, then just substitute "K" for "e" in the last line at

What is happening here is that a new temoporary graphics state is
set up in which the coordinate system has been rotated through 180
degrees. Then the "e" is printed. Then the original graphics state
is restored.

On similar lines, to reflect in a vertical axis it is sufficient
to scale x by -1 and y by +1:

.ds Kreversed "\h'\w'e'u'\X'ps: exec gsave currentpoint \
2 copy translate  -1 1 scale  neg exch neg exch \
translate'K\X'ps: exec grestore'\h'-\w'e'u'

.char \(KR \*[Kreversed]

will do the reflection. (You may also have to shift it right a bit
by a \h'...' to get it where you want it).

To see how this should be done on a large scale (including getting the
metrics right), study the code in ..../groff/font/devps/zapfdr.pfa


E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 284 7749
Date: 23-Aug-00                                       Time: 15:08:15
------------------------------ XFMail ------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]