Steps: 1. Open Writer 2. Write some text 3. Select some text, apply a font colour that's not Automatic (to avoid bug 139751) 4. Format > Character > Font Effects 5. Change Transparency value to a high value, e.g. 70% (so a change would be noticeable) 6. Press Tab to make sure the change registers 7. Change tab in the dialog Result: the preview does not update to show the transparency. On Linux, it only updates after moving to a different dialog tab. Expected: the preview should update as soon as the value changes, just like it does when changing e.g. the Font color in the same tab, or the Scale width in the Position tab, of the Font size in the Font tab, etc. Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 9b41d33a00763bebd5fc70787052222d35a98a52 CPU threads: 4; OS: Windows 11 (10.0 build 22631); UI render: Skia/Raster; VCL: win Already the case on 7.0 at Miklos' 5202771939da66ac85ca3221d69e7e5f5cca8da7. On Linux, before commit 30bc5fdb49621269b7281aace610ca85b150766c, preview would never show transparency; but since 24.2 and commit 30bc5fdb49621269b7281aace610ca85b150766c, preview updates when changing tabs: commit 30bc5fdb49621269b7281aace610ca85b150766c author Caolán McNamara Wed Jun 07 19:50:50 2023 +0100 committer Caolán McNamara Fri Jun 09 12:44:38 2023 +0200 Related: CollaboraOnline#6511 cairo backend can do transparent text Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152719 Caolán, given that your commit slightly improved things on Linux, any thoughts?
I confirm it with Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: 322b158c5c517cb0242e95240928949ab41d95a0 CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: CL threaded
It's possible that setting the color we want to use for the preview text via OutputDevice::SetTextColor instead of using Font::SetColor on the specific font, brings what the dialog does closer to the code paths that work better with this. Not sure if that would completely work, but it might help at least. We end up drawing these previews in SvxFontPrevWindow::Paint and we already explicitly pass down mxTextLineColor and mxOverlineColor for example, so an additional case there that does rRenderContext.SetTextColor with some new TextColor member, and then drop the various Font.SetColor calls in cui/source/tabpages/chardlg.cxx in favor of that alternative approach sounds useful and addresses the " // setting the color on the font is obsolete, the only remaining // valid use is for keeping backward compatibility with old MetaFiles const Color& GetColor() const; const Color& GetFillColor() const; " of include/vcl/font.hxx