groff
[Top][All Lists]
Advanced

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

[Groff] Re: Unicode/UTF-8 support for man


From: Werner LEMBERG
Subject: [Groff] Re: Unicode/UTF-8 support for man
Date: Fri, 18 Aug 2000 08:09:10 +0200 (CEST)

I've added the groff@ list also...

[about a man program which does proper translation for locales]

> My suggestion is that groff should offer a new -Twlocale, in which
> it formats a paragraph as a wchar_t text and then spits it out via
> wprintf() and friends.  The C library will take care of converting
> this to UTF-8, Latin-1, ASCII, transliteration, etc.  For each
> non-ASCII character in a paragraph, groff should query with
> wcwidth(), how many ASCII character cells wide the character will be
> according to the locale.  This should also take care of
> transliteration, i.e. wcwidth(0x2264) == 2 in case the locale
> includes ASCII transliteration and results in wputchar(0x2264) to
> spit out "<=".

To make your suggestion work, gtroff had to construct font description
files on the fly based on the locale; this makes only sense for tty
devices since it is virtually impossible for other devices based on
glyphs instead of characters.  Logically, such an action belongs to
the tty device driver, but this is too late since formatting has
already be done.  So the only solution is to have a preprocessor which
catches the -Twlocale command, translates the input file if necessary,
constructs proper font description files temporarily (which are based
on the devutf8 files), and replaces the -Twlocale with appropriate -T
and -F parameters.

Again, volunteers are welcome to implement this.


    Werner

reply via email to

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