White text on black background doesn't reload properly

  • It seems I can have white text on any color character background EXCEPT black.

    It looks fine and seems to be fine until I save and reload the WPRichText... the black background reloads as white.

    WPTools 5.18.5

  • I think perhaps you misunderstood... I believe the reader is changing the black background to a white background...

    Original RTF (saved to disk using SaveToFile method):

    Zitat

    {\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset0 Arial;}{\f2\fnil\fcharset1 WingDings;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wpprheadfoot1\paperw12240\paperh15840\margl3600\margr720\margt1440\margb1440\headery720\footery720\endnhere\sectdefaultcl{\*\generator WPTools_5.18;}{\plain\f1\fs22\cf12\cb15 this is white on black\par
    }}

    RTF after reloading (using LoadFromFile method):

    Zitat

    {\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset0 Arial;}{\f2\fnil\fcharset1 WingDings;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wpprheadfoot1\paperw12240\paperh15840\margl3600\margr720\margt1440\margb1440\headery720\footery720\endnhere\sectdefaultcl{\*\generator WPTools_5.18;}{\plain\fs22\cf12\cb0 this is white on black\par
    }}

    Notice the background color changed from cb15 to cb0 (black to white) simply by using the SaveToFile and LoadFromFile methods.

    It looks like in your color table, neutral and black are the same (cb0=cb15, i.e. \red0\green0\blue0)... seems not-so-good.

    Eric

  • I just used the toolbar. Note that "Paragragh color" white-on-black is fine... it is "character background color" that doesn't reload if black...

    Here is a simple sequence:

    - Start a new app

    - Add a WPToolBar and WPRichText, and assign the WPToolbar prop of the WPRichText to the toolbar

    - Add two buttons, one to WPRichText1.SaveToFile, and the other to WPRichText.LoadFromFile

    - Enable the "SelBackgroundColor" property in the sel_ListBoxes property of the WPToolBar

    - Run the app

    - type in some text, then select it and change the "background character color" (not paragraph color) to black and the forground character color to white using the toolbar to give you white on black text.

    - Note that it looks fine (white on black).

    - Click the Save button...(look at the results... the RTF looks good)

    - Click the Load button

    - Note that if you didn't clear out the WPRichText before the load, you will now have duplicate text... one still being white on black since nothing has been done to it, but the appended text from the RTF file is white on white (or white on neutral?... simply hightlight it to see that it is there).


    I see that when Word also loads that RTF, it produces white on white... so perhaps cb15 for a background color needs to be revisited. How do you set a bacground color in Word? I used the hightlight color to get a background color, and it uses the "hightlight" RTF code... then I tried shading, and it used yet another RTF code. Couldn't find how to get the cb RTF code using Word.

  • This still fails in 5.19. Do I need to send an example to help out?

    To summarize, if you set the CHARACTER background color to black, it is fine until you SaveToFile and then LoadFromFile. The character color is then no longer black, but reset to white (or neutral perhaps). Setting the character background color to anything but black works fine, and also setting the PARAGRAPH background color to black also works fine.

    Background colors are being set using the toolbar.

    Thanks for all your other fixes!