RTF files losing formatting (text colors) when displayed in Dark Mode

95 views
Skip to first unread message

RC World

unread,
Nov 14, 2025, 11:03:28 AM11/14/25
to innosetup
When using directive InfoBeforeFile, to display a ReadMe.rtf file when setup is running, suddenly all color formatting from RTF file is dropped. The file is presented in black and white text with no color at all, when running under Dark Mode. 

If I leave WizardStyle directory out, the ReadMe.rtf file displays correctly.

Is it on purpose? Thanks

Martijn Laan

unread,
Nov 14, 2025, 12:39:17 PM11/14/25
to innosetup
Op 14-11-2025 om 17:03 schreef RC World:
RTF files losing formatting (text colors) when displayed in Dark Mode

It does that on purpose, else you would get black text on a black background (or black on dark blue if you use Polar, etc).

So, when a custom style (including the built-in dark style) is used, the custom style determines all colors, including those in RTF files.

Are you saying you would like an InfoBeforeFileDynamicDark directive to supply a secondary RTF file with dark mode colors?

Or were you expecting the text to appear with a white background instead? That would somewhat defeat the purpose of having a dark mode.

I do now realize it also drops colors when a custom style is used in light mode, like Zircon. That isn't really necessary.

Greetings,
Martijn

RC World

unread,
Nov 14, 2025, 1:53:40 PM11/14/25
to innosetup
What I'm doing is designing the RTF document to work on both backgrounds (Light and Dark) using colors that can be visible in both situations. Red Blue Green Yellow Magenta can be used in both scenarios without any issues. But, will leave to your discretion...

Regards,

Martijn Laan

unread,
Nov 14, 2025, 4:52:39 PM11/14/25
to innosetup
I'm not sure the contrast ratio's of those colors would be proper for both scenarios, but surely you are using black as well right? It's missing in your list of colors. I don't think there's a reasonable way in which it could replace black colors with white, while at the same time not replacing all (or some?) other colors.

Greetings,
Martijn 

-------- Original Message --------
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/dc3818df-a656-4ead-ae35-af0f7cce4857n%40googlegroups.com.

RC World

unread,
Nov 14, 2025, 11:48:45 PM11/14/25
to innosetup
You are right, I'm using black for general text, and color for headings. Some white text with colored or black backgroud also. But, as you mentioned, the custom Dark Style, will override the colors from the RTF file. I can live with that, it is just a matter of creating a fancy readme file to display to the user installing the app. Will create a plain B&W RTF file then...

Thank you very much for your attention to this matter

Regards,

D.

Alex Born

unread,
Nov 16, 2025, 4:04:37 AM11/16/25
to innosetup
However, if you use Rodrigo Ruz's VCL Styles plugin for Inno Setup, the color formatting of the text in the RTF document is not lost.

Example. VclStylesinno.dll plugin and Amakrits.vsf style
002.png

And without the plugin
001.png

суббота, 15 ноября 2025 г. в 05:48:45 UTC+1, RC World:

Martijn Laan

unread,
Nov 16, 2025, 4:57:21 AM11/16/25
to innosetup
Hey,

Op 16-11-2025 om 10:04 schreef Alex Born:
However, if you use Rodrigo Ruz's VCL Styles plugin for Inno Setup, the color formatting of the text in the RTF document is not lost.

Interesting, thanks. Do you know how he achieved that? His main VCL Styles Utils project is full of techniques I do not consider reasonable myself, but maybe this one is okay.

I do notice the contrast is really bad. Is this really usable? It would be better readable without the colors.

I don't understand what the "And without the plugin" screenshot is trying to show. BTW, I did already remove the color dropping when a light style is active for the next version.

Greetings,
Martijn

Jernej Simončič

unread,
Nov 16, 2025, 5:51:04 AM11/16/25
to 'Martijn Laan' via innosetup on [innosetup]

On Sunday, November 16, 2025, 10:57:09, 'Martijn Laan' via innosetup wrote:


Interesting, thanks. Do you know how he achieved that? His main VCL Styles Utils project is full of techniques I do not consider reasonable myself, but maybe this one is okay.

I'd check how RTF text is rendered when the text colour isn't set – that should result in the RTF control using Windows text colour (which I assume the theme will override); this is also how RTF files are rendered in high contrast mode (text without colour set uses whatever the Windows foreground colour is, while text with explicit colour is shown with that; it does sometimes result in unreadable text, when colour was explicitly set to black).

 

I do notice the contrast is really bad. Is this really usable? It would be better readable without the colors.

That example is pretty bad, but IMHO if the installer is set up to support dark themes and uses coloured RTF, it's the responsibility of creator to make sure that the text is readable.

 

-- 
< Jernej Simončič ><><><><>< https://eternallybored.org/ >


A statement may be true independently of illogical reasoning.
       -- Berkeley's Eighth Law

Martijn Laan

unread,
Nov 16, 2025, 6:55:05 AM11/16/25
to 'Martijn Laan' via innosetup on [innosetup]
Hey,

Op 16-11-2025 om 11:50 schreef Jernej Simončič:
I'd check how RTF text is rendered when the text colour isn't set – that should result in the RTF control using Windows text colour (which I assume the theme will override)

I checked the code at https://github.com/RRUZ/vcl-styles-plugins/blob/master/InnoSetup%20plugin/Vcl.Styles.InnoSetup.StyleHooks.pas and it's the same code as we have, except that it uses a SysStyleHook instead of a regular StyleHook. I don't know if that's what making the difference or not, but otherwise I see nothing special. The code which sets up the SysStyleHook for something which is not a system class like TRichEditViewer looks like something I wouldn't want to include. It's found athttps://github.com/RRUZ/vcl-styles-plugins/blob/b01e8d7ad33fe63accd98b949763ee16d8ce85ae/InnoSetup%20plugin/Vcl.Styles.InnoSetup.pas#L205

Do note that 'check how RTF text is rendered' as you say does not apply. The RFT text is still rendered by Windows, and not by us or by this plugin.


; this is also how RTF files are rendered in high contrast mode (text without colour set uses whatever the Windows foreground colour is, while text with explicit colour is shown with that; it does sometimes result in unreadable text, when colour was explicitly set to black).


I believe you're referring to CFE_AUTOCOLOR. AFAIK it changes the color of all text, not just the color of black text. And do note that the Windows foreground color (COLOR_WINDOWTEXT) is not changed by us nor by this plugin.


That example is pretty bad, but IMHO if the installer is set up to support dark themes and uses coloured RTF, it's the responsibility of creator to make sure that the text is readable.


Is that actually possible? For example, what shades or red, green and blue have a proper contrast ratio on both black and white?

Here's a checker: https://webaim.org/resources/contrastchecker/ Even at just AA, full red fails on white, full green fails on white, full blue fails on black.

@Alex, can you share your RTF please so I can check if there's perhaps something special in it?

Greetings,
Martijn

Alex Born

unread,
Nov 16, 2025, 7:08:45 AM11/16/25
to innosetup
Martijn Laan  - "I don't understand what the "And without the plugin" screenshot is trying to show. "
Jernej Simončič - " That example is pretty bad..."

The specified text colors in the RTF document are not reset when using a dark theme and look the same on both light and dark themes.

This is shown in the screenshots with and without the plugin.

If you use the new Inno Setup theme settings, all colors in the RTF document are reset.

WizardStyle=modern light

003.png

WizardStyle=modern dark
004.png

With VclStylesinno.dll plugin - all is OK.
воскресенье, 16 ноября 2025 г. в 11:51:04 UTC+1, Jernej Simončič:

Martijn Laan

unread,
Nov 16, 2025, 7:17:20 AM11/16/25
to innosetup
Hey,

Op 16-11-2025 om 13:08 schreef Alex Born:

If you use the new Inno Setup theme settings, all colors in the RTF document are reset.


Yes, for dark mode that is as intended.


With VclStylesinno.dll plugin - all is OK.

The statement that "all is OK" with the plugin is subjective, as I find the text is not properly readable.

Having said that, I am still interested in how the plugin achieves its behavior, but have not been able to figure it out yet. 

Greetings,
Martijn

Alex Born

unread,
Nov 16, 2025, 7:19:47 AM11/16/25
to innosetup
" @Alex, can you share your RTF please so I can check if there's perhaps something special in it? "
Yes. Look in attach.
воскресенье, 16 ноября 2025 г. в 13:08:45 UTC+1, Alex Born:
ReadMe.rtf

Jernej Simončič

unread,
Nov 16, 2025, 8:40:49 AM11/16/25
to 'Martijn Laan' via innosetup on [innosetup]

On Sunday, November 16, 2025, 12:54:54, 'Martijn Laan' via innosetup wrote:


I believe you're referring to CFE_AUTOCOLOR. AFAIK it changes the color of all text, not just the color of black text. And do note that the Windows foreground color (COLOR_WINDOWTEXT) is not changed by us nor by this plugin.

I'm specifically referring to this:

 

Notice how the Normal text is rendered with the same colour as the labels (as is the text with background highlights). Is it possible for Inno's themes to do the same thing?

 

Is that actually possible? For example, what shades or red, green and blue have a proper contrast ratio on both black and white?

For red, #eb0000 seems to pass, for green it's #008a00 and #6161ff for blue.

 

-- 
< Jernej Simončič ><><><><>< https://eternallybored.org/ >


The most undesirable things are the most certain (death and taxes).
       -- Gumperson's Proof
colortest.rtf

Martijn Laan

unread,
Nov 16, 2025, 9:37:31 AM11/16/25
to 'Martijn Laan' via innosetup on [innosetup]
Thanks for the rtf and colors. 

Your screenshot is with a high contrast theme active, correct?

Greetings,
Martijn



-------- Original Message --------
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.

Martijn Laan

unread,
Nov 16, 2025, 11:12:12 AM11/16/25
to inno...@googlegroups.com
Hi,

Op 16-11-2025 om 14:40 schreef Jernej Simončič:
Notice how the Normal text is rendered with the same colour as the labels (as is the text with background highlights). Is it possible for Inno's themes to do the same thing?

I found a different approach, but with the same result.

When the style's text color is not the same as COLOR_WINDOWTEXT, I made it use functions of the Windows RTF control to scan for sections of text with a CFE_AUTOCOLOR effect. Windows displays such sections with a COLOR_WINDOWTEXT text color.

Found sections then have their the text color changed to the one from the style, while keeping other colors and effects.

This exactly replicates the behaviour from your screenshot as far as I can tell.

Note that it does not check for background colors currently. So if you use 'auto' colors with a 'non-auto' background like you have in colortest.rtf, some text may become invisible. I think it's up to you to not use 'auto' colors in this case. This also is same as in your screenshot.

See below. First is with Alex's RTF, edited by me using LibreOffice Writer to introduce some an extra bold section in the black text, and partially bold link. Second is with your RTF, unchanged. Third is with a light style, in which case it doesn’t change any foreground colors (which is unlike 6.6.0). Fourth is without a style.

Thanks for your test file and screenshot, very helpful.

Greetings,
Martijn














Alex Born

unread,
Nov 16, 2025, 11:14:51 AM11/16/25
to innosetup
Martijn,

Inno Setup 6.6.0 | WizardStyle=modern dark |  high contrast theme is NOT active
HG_Off-def.png

Inno Setup 6.6.0 | WizardStyle=modern |  high contrast theme is NOT active | with plugin VCL Styles and WINDOWS11_DARK.vsf 
HG_Off-plug.png

Inno Setup 6.6.0 | WizardStyle=modern dark |  high contrast theme is active 
HG_On-def.png

Inno Setup 6.6.0 | WizardStyle=modern |  high contrast theme is active | with plugin VCL Styles and WINDOWS11_DARK.vsf  
HG_On-plug.png
воскресенье, 16 ноября 2025 г. в 15:37:31 UTC+1, Martijn Laan:

Martijn Laan

unread,
Nov 16, 2025, 11:19:39 AM11/16/25
to innosetup
Hi Alex,

Thanks, but my reply and question was to Jernej.

Anyway, see my other post  for an update. I will post a test build for it later.

Greetings,
Martijn

Jernej Simončič

unread,
Nov 16, 2025, 12:58:43 PM11/16/25
to 'Martijn Laan' via innosetup on [innosetup]

On Sunday, November 16, 2025, 15:37:20, 'Martijn Laan' via innosetup wrote:


Your screenshot is with a high contrast theme active, correct?

Correct.

 

-- 
< Jernej Simončič ><><><><>< https://eternallybored.org/ >


Every employee begins at his level of competence.
       -- Peter's Hidden Postulate According to Godin

Martijn Laan

unread,
Nov 16, 2025, 1:09:31 PM11/16/25
to 'Martijn Laan' via innosetup on [innosetup]
FWIW, I believe I also found how the plugin achieves its result:

It uses the DDetours library to hook the GetSysColor function so the the Windows Rich Edit control gets a style color back when it asks for the COLOR_WINDOWTEXT. See https://github.com/RRUZ/vcl-styles-utils/blob/6a327f25a91a19f19c5110d9977484c489492c35/Common/Vcl.Styles.Hooks.pas#L113 and https://github.com/RRUZ/vcl-styles-utils/blob/6a327f25a91a19f19c5110d9977484c489492c35/Common/Vcl.Styles.Hooks.pas#L824

To me, this goes a few bridges too far and is not acceptable code. I am happy with the other approach.

I've also confirmed that a clean Delphi project with a Rich Edit control displays bad colors, since it doesn't do anything at all, so you get black on black.

Uploaded a test build: https://files.jrsoftware.org/is/dev/innosetup-6.6.1-dev.exe

Greetings,
Martijn

Op 16-11-2025 om 17:12 schreef Martijn Laan:

Alex Born

unread,
Nov 16, 2025, 2:44:45 PM11/16/25
to innosetup
Martijn,

Great! It works now :)

Thanks for your hard work.


воскресенье, 16 ноября 2025 г. в 19:09:31 UTC+1, Martijn Laan:

Martijn Laan

unread,
Nov 16, 2025, 2:56:36 PM11/16/25
to innosetup
Great, thanks for testing and letting me know.

I've actually improved the new approach by using the Rich Edit OLE interface instead of Windows messages. It's cleaner and faster, though you won't probably really notice a difference.

Updated the test build with this, same link as before: https://files.jrsoftware.org/is/dev/innosetup-6.6.1-dev.exe

Greetings,
Martijn

Op 16-11-2025 om 20:44 schreef Alex Born:
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.

Alex Born

unread,
Nov 17, 2025, 4:01:50 PM11/17/25
to innosetup

MartijnWith the latest change, when you said, 

  “I've actually improved the new approach by using the Rich Edit OLE interface instead of Windows messages,..”

 the default text no longer changes and is not visible with the dark theme.

005.png

Everything was fine in the previous build.

Could you please check again?


воскресенье, 16 ноября 2025 г. в 20:56:36 UTC+1, Martijn Laan:

Martijn Laan

unread,
Nov 18, 2025, 3:44:29 AM11/18/25
to innosetup
Hi,

Thanks for testing again. I found the issue, the new approach is sensitive to the ReadOnly setting, whereas the old one wasn't. And I was testing with ReadOnly still off at the moment of recoloring (specifically from CodeClasses.iss).

Updated the test build, same link as before: https://files.jrsoftware.org/is/dev/innosetup-6.6.1-dev.exe

Greetings,
Martijn

Op 17-11-2025 om 22:01 schreef Alex Born:

MartijnWith the latest change, when you said, 

  “I've actually improved the new approach by using the Rich Edit OLE interface instead of Windows messages,..”

 the default text no longer changes and is not visible with the dark theme.


Bruno Lopes da Silva

unread,
Nov 18, 2025, 2:55:39 PM11/18/25
to innosetup
Hi. I tested the latest innosetup-6.6.1-dev.exe and this is how it renders:

Captura de tela 2025-11-18 165125.png


There is something we need to do on GIMP side, Jernej?

Martijn Laan

unread,
Nov 18, 2025, 4:10:52 PM11/18/25
to innosetup
Hi,

Are you sure you used the latest version? And does this happen with Example1.iss? I notice you likely have custom code since there are no radio buttons to accept or decline the license.

Your rtf works fine for me.

Greetings,
Martijn



Op 18-11-2025 om 20:55 schreef Bruno Lopes da Silva:
Hi. I tested the latest innosetup-6.6.1-dev.exe and this is how it renders:



Jernej Simončič

unread,
Nov 18, 2025, 4:48:40 PM11/18/25
to 'Martijn Laan' via innosetup on [innosetup]

On Tuesday, November 18, 2025, 22:10:37, 'Martijn Laan' via innosetup wrote:


Are you sure you used the latest version? And does this happen with Example1.iss? I notice you likely have custom code since there are no radio buttons to accept or decline the license.

It's using the InfoBeforeFile page, not License (because there's no need for end-user to agree to GPL), but the newer 6.6.1-dev works fine (you might want to start adding a build number to dev versions, so there's less confusion).

 

-- 
< Jernej Simončič ><><><><>< https://eternallybored.org/ >


If the assumptions are wrong, the conclusions aren't likely to be very good.
       -- Burns's Balance
Reply all
Reply to author
Forward
0 new messages