Re: fcharset value in RTF backend

Subject: Re: fcharset value in RTF backend
From: "Andrey Taranov" <andrey@xxxxxxxxxxxxx>
Date: Thu, 26 Aug 1999 20:00:42 +0400
Hello All,

Paul Romanchenko wrote:

| I'm using you stylesheets for converting docbook into rtf (thank you!).
| I have a small problem -- stylesheet creates rtf with
| \fcharset0 setted for all fonts. Because I use native language (Cyrillic),
| I have to change \fcharset0 to \fcharset240.
| Where I may change this behavoir in stylesheets?

To Paul:

Which OS do you use? I work with jade under NT (and Win95) and everything
comes out fine. Cyrillic text in RTF output uses font definitions with
\fcharset204 (not 240, in fact -- your mistake).

To anybody interested:

I investigated the mechanics behind this. Is goes like this:
Jade transforms input characters from upper half of ASCII to Unicode, using
RtfFOTBuilder::winCharsets table. Besides, there is another table
RtfFOTBuilder::charTable_ for Unicode->RTF translation. Each know Unicode
character is assigned an ASCII character number and an RTF charset number.
When a text character is processed in RtfFOTBuilder::characters(...)
procedure, it uses RtfFOTBuilder::charTable_ to look up certain RTF charset
number (really just an internal-to-jade number, not standard code like 204).
It then calls RtfFOTBuilder::setCharset() with this number. setCharset() in
it's turn looks up the RTF font number for the current font family and
specified charset.

As a result, we get a font table with an entry for each occuring charset in
a particular font family. Example follows:

    {\fonttbl{\f4\fnil\fcharset0 Courier New;}
    {\f3\fnil\fcharset204 Courier New CYR;}
    {\f1\fnil\fcharset0 Arial;}
    {\f2\fnil\fcharset204 Arial CYR;}
    {\f0\fnil\fcharset0 Times New Roman;}
    }

To Didier:

BTW, is this long passage of any interest to your efforts of documenting
OpenJade internals? Or is this behaviour already documented? If my
investigations are of some value, maybe I have some more to share...

Andrey Tarnov                    mailto:andrey@xxxxxxxxxxxxx
Customized Information Systems
Moscow, Russian Federation


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread