groff
[Top][All Lists]
Advanced

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

Re: [Groff] Installing Russian Type-1 Fonts


From: Anton Shepelev
Subject: Re: [Groff] Installing Russian Type-1 Fonts
Date: Fri, 19 Aug 2011 23:26:43 +0400

Sorry for the mangled text in the previous message.

Werner LEMBERG:

> I've  posted  a  solution  a  few years ago to the
> groff list which is still valid.

Ah, thank you. So you are mapping the Russian alpha-
bet to internal characters correspoinding to KOI-8-R
and then using a hyphenation  pattern  in  the  same
encoding.

This  way, not only UTF-8 input may be fed to groff,
but also KOI-8-R --  just  omit  preconv  processing
(the -K or -k option to groff)!

Here's my understanding of what happens:

----------------------------------------------------
       8-bit input                UTF-8 input
----------------------------------------------------
The  input  file  is read  The input file  is  first
in, and  the  input  map-  processed   by   preconv,
ping, in your case speci-  that converts input char-
fied in  koi8-r.tmac,  is  acters  into AGL-compati-
applied.  As  the result,  ble inner entities. Then,
the text is converted  to  the   mapping   file   is
AGL-compatible   sequence  applied, but  it  has  no
of entities.               effect, because the input
                           stream  now  consists  of
                           directly   specifed  AGL-
                           compatible  entities   in
                           the form \[uXXXX].

Hyphenation  patterns  are  read  and converted into
hyphenation codes.

Since hyphenation patterns must be  matched  against
the  text in terms of hyphenation codes, groff needs
somehow to derive the hyphenation code for  each  of
the  internal  entities  constituting  its input. It
cannot be done directly with  the  input  characters
because they can have been translated by preconv.

Therefore, I suppose that groff applies the existing
character translations inversely to get back to some
simple  characters.  Then,  hyphenation codes can be
computed and compared against the  hyphenation  pat-
terns.
----------------------------------------------------

So, only the input stream gets processed by preconv,
while the hyphenation codes and patterns are read in
directly.  To  make pattern matching possible, a set
of .trin commands is used to define a  mapping  from
internal entites to simple input characters and, via
.hcode requests, to hyphenation codes.

But generally, this map cannot be inversely  applied
becuase  several input characters may be mapped into
one internal entity. What  does  groff  do  in  this
case?

It wasn't clear that preconv is only used with input
files, but not with hyphenation codes and patterns.

Anton



reply via email to

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