groff
[Top][All Lists]
Advanced

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

Re: [Groff] An uppercase mode


From: Werner LEMBERG
Subject: Re: [Groff] An uppercase mode
Date: Tue, 22 Nov 2011 23:06:30 +0100 (CET)

> Sorry for the innacurate example.  I used a latin letter instead of
> a Russian one and a random unicode entity just to show the kind of
> translation I was using.
> 
> Here is what I want to do (the Cyrillic symbols in this e-mail are
> in KOI8-R):
> 
>           Input                    Result
> 
>   This is normal case      This is normal case
>   .br                      Это нормальный регистр
>   Это нормальный регистр   THIS IS UPPER CASE
>   .br                      ЭТО ВЕРХНИЙ РЕГИСТР
>   .UPCASE ON
>   This is upper case
>   .br
>   Это верхний регистр
> 
> But I can't find how to implement this in the latin1 device.

What about doing it the naïve way?

File `lcuc' in UTF-8 encoding:

  .de UPCASE
  .  ie '\\$1'ON' \{\
  .    tr тТоОвВеЕрРхХнНиИйЙгГсС
  .    tr hHiIsSuUpPeErRcCaA
  .  \}
  .  el \{\
  .    tr ттооввееррххннииййггсс
  .    tr hhiissuuppeerrccaa
  .  \}
  ..

  This is normal case
  .br
  Это нормальный регистр
  .br
  .UPCASE ON
  This is upper case
  .br
  Это верхний регистр

processed with

  groff -k -Tutf8 lcuc > lcuc.txt

yields

  This is normal case
  Это нормальный регистр
  THIS IS UPPER CASE
  ЭТО ВЕРХНИЙ РЕГИСТР

Provided you have proper PS fonts, this works with -Tps also.

Am I missing something?


    Werner

reply via email to

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