groff
[Top][All Lists]
Advanced

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

Re: [Groff] Accents in output


From: Werner LEMBERG
Subject: Re: [Groff] Accents in output
Date: Thu, 29 Jan 2004 16:18:03 +0100 (CET)

> > I'm particularly interested in c, g, h, j and s with circumflex
> > (ĉĝĥĵŝ), and u with breve (ŭ). I understand that I can't enter
> > UTF-8 at present, but neither \(c^ or \[^c] works for me. For that
> > matter, nor does \[^a].
> >
> > Just in case it matters, I'm variously using ms, mandoc and mom
> > macros, but this looks like a basic groff matter.
>
> Indeed it is ... the key to it (assuming you're using PostScript
> output) is in constructing the composite glyph (character+accent),
> since (pre-UTF8 and anyway in PS) you only get a few accented
> characters as pre-cooked glyphs, and you have to compose anything
> else yourself.

Ted describes how to cook accented characters for the ms macro
package.  Meanwhile, I've implemented something better in groff which
is independent of the macro package.

Since version 1.19, groff has a notation for composite glyphs: For
example, the character `ĉ' should be accessed as `\[c ^]'. (*)

Internally, groff maps `^' to entity `u0302' (see file
`composite.tmac') and `c' to `u0063'; finally, the elements are
combined to the final glyph name `u0063_0302'.  If you have a PS font
which contains the glyph `u0063_0302' (PS name `ccircumflex'),
afmtodit will correctly provide this glyph.  Otherwise, you get a
warning that glyph `u0063_0302' can't be found.

To build an accented character like `ĉ' manually for the PS device you
should do this:

  .ps-achar "\[c ^]" ^ c c

This is fully equivalent to

  .ps-achar \[u0063_0302] ^ c c

but more readable.

The macro `ps-achar' is defined in the startup file for the PS output
device, `ps.tmac'.  Similar macros are defined for other output
devices.


   Werner


(*) You can still say

      .char \[^c] \[c ^]

    or something similar if you prefer.


reply via email to

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