Reputation: 19087
I am trying out the VCL Visual Styles as an alternative to the skinning DLL I was previously using.
At the moment I am using the skin:
#define Skin "Carbon.vsf"
When the installer shows the RTF License file file the colouring is not as I expect:
The text is black and the background dark. But the other two pages are better:
I specify all my license files in the usual way in the [Languages]
section:
Name: "English"; MessagesFile: "compiler:Default.isl"; LicenseFile: "..\..\Inno\l.eng\LicenseEnglish.rtf"; InfoAfterFile: "..\..\Inno\l.eng\InfoAfterEnglish.rtf"
How can I set this skin to use white text for the license file (like on the other pages I have shown)? Why doesn't it do so anyway?
Ideally i would like the Visual Studio 2019 Dark Theme as the skin but don't know how to do that - separate issue!
If I try Amakrits style the license page looks like this:
And:
So it is doing the same thing for multiple style definitions.
Upvotes: 1
Views: 305
Reputation: 41
I disagree that this is a RTF issue. I am not sure what type control is being used to display the License but it seems to be an issue with handleing color text in RTF that was written out by WORD.
In the document: https://www.biblioscape.com/rtf15_spec.htm it defines the color table rtf element.
The \colortbl control word introduces the color table group, which defines screen colors, character colors, and other color information. This group has the following syntax:
<colortbl> '{' \colortbl <colordef>+ '}'
<colordef> \red ? & \green ? & \blue ? ';'
The following are valid control words for this group.
Control word Meaning
\redN Red index
\greenN Green index
\blueN Blue index
Each definition must be delimited by a semicolon, even if the definition is omitted. If a color definition is omitted, the RTF reader uses its default color. The example below defines the default color table used by Word. The first color is omitted, as shown by the semicolon following the \colortbl control word. The missing definition indicates that color 0 is the `'auto'' color.
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
The foreground and background colors use indexes into the color table to define a color. For more information on color setup, see your Windows documentation.
The following example defines a block of text in color (where supported). Note that the cf/cb index is the index of an entry in the color table, which represents a red/green/blue color combination.
{\f1\cb1\cf2 This is colored text. The background is color
1 and the foreground is color 2.}
If the file is translated for software that does not display color, the reader ignores the color table group.
It appears that text that is marked with a color of black does not display properly if you are using a dark background in a style. I opened the rtf file in WordPad and selected all of the text and changed the text color to automatic and it seems to display properly.
I also tried changing some text color to green and it displayed properly. So I think it is best to set the color of all text that is black to automatic and judge the other color texts against the style you are using...
======
Found this which also might be relevant:
The \cfColorNum command is a character-formatting command that sets the text color to whatever palette entry number ColorNum was defined to be. So, given the above color table, {\cf1 yow!} puts the word “yow!” in red type.
The RTF specification also defines a command (\cbColorNum) that does for the background of the text what \cfColorNum does for the foreground. For example, if you had {\cb5 yow!} and defined palette entry 5 as light yellow, it would look like the word “yow!” had been gone over with a highlighter pen. But in one of the few cases I’ve yet found of Microsoft completely disregarding their own RTF specification, MSWord simply does not implement the \cb command. Instead, it implements exactly the same function with a different construct: \chshdng0\chcbpatColorNum, in which ColorNum is the same number as would be used in a \cbColorNum command.
Regrettably, MSWord seems to be the only word processor at present that understands the \chshdng0\chcbpatColorNum construct; so in order to set the background color, you should use \chshdng0\chcbpatColorNum and \cbColorNum:
{\chshdng0\chcbpat5\cb5 yow!}
Upvotes: 1
Reputation: 19087
For the benefit of readers of this question I had to re-create my RTF file in WordPad. It had been created in Microsoft Word and that seems to be the reason. Either that or some other RTF encoding issue.
Eitherway, creating the file again WordPad resolved the problem.
Upvotes: 1