Bug 296845

Summary: Font rendering broken in OS X
Product: [Unmaintained] kfile Reporter: Rich <richardthanki>
Component: kurlnavigatorAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: cfeck, hugo.pereira.da.costa, mk-lists, rjvbertin, vernnobile
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Dolphin screenshot
Kate screenshot
Patched header file
Patch for KUrlNavigatorButtonBase code
Example for navigator in develop

Description Rich 2012-03-26 23:16:17 UTC
Created attachment 69920 [details]
Dolphin screenshot

Installed KDE base apps and Kate from MacPorts. Everything is working beautifully, almost as well as a native Linux installation - except one thing. The font rendering. As shown in the screenshot attached. (It's also broken in Kate).
Comment 1 Rich 2012-03-26 23:17:34 UTC
Created attachment 69921 [details]
Kate screenshot
Comment 2 Hugo Pereira Da Costa 2012-04-02 14:22:11 UTC
Do you have the same issue if you change 
- widget style ? (to non oxygen)
- widget fonts ?
My suspicion is that the issue has nothing to do with oxygen (though I might be wrong).
Comment 3 vernon adams 2012-04-15 16:25:54 UTC
To test the source of this issue, please test with other fonts as the UI font. UI font can be changed fro desktop preferences. Is is one or many fonts that render with this issue?
Comment 4 Christoph Feck 2013-04-23 23:33:59 UTC
The problem here is that OS X has two font sizes, QToolButton defaults to using the small font size when the OS X style is used (in concordance with the Apple HIG), but applications incorrectly use the standard font size for rendering.

Dolphin screen shot shows KUrlNavigator, reassigning.

Kate screen shot is bug 258279.
Comment 5 Christoph Feck 2014-03-16 11:05:55 UTC
*** Bug 332202 has been marked as a duplicate of this bug. ***
Comment 6 Marko Käning 2014-03-16 12:00:52 UTC
This issue lingers around since ages here. Is there noone who could make tests?

If so, what can I do to take care of it myself? Hints welcome. :)
Comment 7 Christoph Feck 2014-03-16 14:49:10 UTC
Marko, you could try making KUrlNavigatorButtonBase inherit from QAbstractButton instead of QPushButton. I think the layouting of the QtMacStyle's QPushButton is responsible for the shifted text, but this is just a blind guess (I have no Mac to test).

When hovering over the button, is the item's selection rendering also overlapping the arrow?
Comment 8 Marko Käning 2014-03-16 14:53:09 UTC
(In reply to comment #7)
> Marko, you could try making KUrlNavigatorButtonBase inherit from
> QAbstractButton instead of QPushButton. I think the layouting of the
> QtMacStyle's QPushButton is responsible for the shifted text, but this is
> just a blind guess (I have no Mac to test).

Hmm, that means I would have to patch KDE's sources, create a patch and upgrade KDE to the patched version, before I can rebuild Dolphin to test its effect, right?!


> When hovering over the button, is the item's selection rendering also
> overlapping the arrow?
Yes, same thing. The arrow's surroundings get rendered a little darker. That's all the difference there is.
Comment 9 Marko Käning 2014-03-16 17:28:13 UTC
Created attachment 85604 [details]
Patched header file
Comment 10 Marko Käning 2014-03-16 17:28:56 UTC
Created attachment 85605 [details]
Patch for KUrlNavigatorButtonBase code
Comment 11 Marko Käning 2014-03-16 17:29:58 UTC
kdelibs4 is building right now.

I am wondering whether I'd need to rebuild all dependent libraries and apps as well...
Comment 12 Marko Käning 2014-03-16 17:36:11 UTC
I have to realise that my changes were too drastic, since suddenly other code would not work with those patches anymore:

:info:build /opt/local/var/macports/build/_Users_okram_WC_MacPorts_ports_kde_kdelibs4/kdelibs4/work/kdelibs-4.12.2/kfile/kurlnavigatorplacesselector.cpp:60:5: error: use of undeclared identifier 'setMenu'; did you mean 'QPushButton::setMenu'?
:info:build     setMenu(m_placesMenu);
:info:build     ^~~~~~~
:info:build     QPushButton::setMenu
:info:build /opt/local/include/QtGui/qpushbutton.h:80:10: note: 'QPushButton::setMenu' declared here
:info:build     void setMenu(QMenu* menu);
:info:build          ^
:info:build /opt/local/var/macports/build/_Users_okram_WC_MacPorts_ports_kde_kdelibs4/kdelibs4/work/kdelibs-4.12.2/kfile/kurlnavigatorplacesselector.cpp:60:5: error: call to non-static member function without an object argument
:info:build     setMenu(m_placesMenu);
:info:build     ^~~~~~~
Comment 13 Marko Käning 2014-03-25 20:19:26 UTC
Created attachment 85746 [details]
Example for navigator in develop

This is an example (taken from kdevelop) where the navigator looks odd, because the string "Home" is written over the little triangle.

Interesting is, that the tree view below doesn't show any overlapping of triangles and corresponding icon following them...
Comment 14 Christoph Feck 2014-03-25 21:29:38 UTC
Yes, below is a different widget, not a KUrlNavigator.
Comment 15 Marko Käning 2014-03-25 21:31:37 UTC
(In reply to comment #14)
> Yes, below is a different widget, not a KUrlNavigator.

I know, but I had hoped that that might help figuring out what to do for KUrlNavigator, but I guess that's not comparable, since for the latter it is text and for the other an image. (Sorry for the noise then.)
Comment 16 Marko Käning 2014-10-09 05:50:25 UTC
All this is not an issue if I do NOT use the "Macintosh (aqua)" theme. The standard KDE themes are fine (apart from a redraw glitch in pulldown menus) but best works QtCurve.
Comment 18 RJVB 2016-06-09 17:14:50 UTC
Fixed in #bd3b3c8b8af249c1dc3c020c09b8bab479411503