Bold text cutoff in GTK

Bug #1836498 reported by Ian McInerney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Expired
Low

Bug Description

In the confirmation dialog that asks about unsaved changes when you close the window there is some text being cutoff. It appears to be related to the use of wxRichMessageDialog, since it only effects libedit on Linux (every other unsaved changes dialog uses the normal wxMessageDialog). See the attached screenshot for an example. The text should have "closing?" visible on the end, and also the lower extents of the lower row of text are cutoff (e.g. the bottom of y, p, etc.).

I think this is more of a wx bug than a KiCad bug, but I don't know which platforms it affects. Do any OSX devs see this in any of the dialogs? All of the unsaved changes confirmation dialogs there use the rich message. Is this visible in libedit on Windows?

Application: LibEdit
Version: (5.1.0-1255-g20036f810-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 brotli/1.0.7 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.7/openssl/zlib nghttp2/1.37.0
Platform: Linux 5.1.16-300.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: Clang 8.0.0 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Ian McInerney (imcinerney) wrote :
Revision history for this message
Jeff Young (jeyjey) wrote :

OSX does use the wxRichMessageDialog (in fact for all unsaved changes dialogs, rather than just libedit), but doesn't seem to have this bug.

Revision history for this message
Seth Hillbrand (sethh) wrote :

That's funny, I never noticed that on Linux because my font made the cutoff where it was gramatical :)

summary: - Text cutoff in save confirmation dialog
+ Bold text cutoff in GTK
Revision history for this message
Ian McInerney (imcinerney) wrote :

So, after some digging it appears this issue is both inside wxWidgets and also affects more than just the save dialog box. First of all, it appears to be a GTK-only issue. From what I gather the problem is that the wxStaticText objects are not being resized properly when the font is converted to bold face after creation [1], [2] due to a change in how GTK processes sizing updates. The way wxWidgets responded to that change is to fire a EVT_SIZE event on font change, and then make the user redo the sizing in a handler [3]-[4].

As mentioned, this affects more than just the save windows. Looking into the About window, it is clear some text is being cutoff (see the new attached image where the cateogry labels should have the text "by:" on the end).

The fix for the save dialog is fairly simple, but I have not figured out a good way of patching all the other text objects that display this issue. Another thing I found was that if the text is changed, the objects don't seem to resize either. I don't know if we change any text inside the wxStaticText objects, but that could also be an issue on GTK.

TLDR: GTK + Bold static text = text cutoff everywhere

[1] https://trac.wxwidgets.org/ticket/16088
[2] https://forums.wxwidgets.org/viewtopic.php?t=42515
[3] https://github.com/wxWidgets/wxWidgets/commit/101c43d0aa703a843f177c449fad73951de199c3
[4] https://github.com/wxWidgets/wxWidgets/commit/3b4ee5a031b1c2fa29772b90751a82dd7f1d3de0

Revision history for this message
Jeff Young (jeyjey) wrote : Re: [Bug 1836498] Re: Bold text cutoff in GTK

@Ian, is there an easy way to make (at least) wxRichMessageDialog not bold the text? It doesn’t look great anyway, even without the bug.

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Jeff, if we consolidate the strings so that both the main message (the current bold text) and the extended message (the fixed string saying save or else) are in the message of the dialog (and then the extended message is empty), no bold text will be used. I quickly mocked that up and attached a version of what the dialog could look like. I do think it looks better (and not just because there is no text cutoff).

Revision history for this message
Jeff Young (jeyjey) wrote :

@Ian, cool. It tried it out on OSX, and it looks better there too.

(OSX doesn't get the separator line that GTK has, though, so an additional newline after the "if you don't save..." string improves things even further.)

Changed in kicad:
importance: Undecided → Low
milestone: none → 6.0.0-rc1
status: New → Confirmed
Changed in kicad:
assignee: nobody → Ian McInerney (imcinerney)
tags: added: gtk
tags: added: wxwidgets
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/1915

Changed in kicad:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.