Bug 502925 - Fonts are smaller in Qt apps than GTK+ apps
Summary: Fonts are smaller in Qt apps than GTK+ apps
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: qt
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-27 19:42 UTC by gene smith
Modified: 2010-02-28 21:15 UTC (History)
11 users (show)

Fixed In Version: 4.6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-02-24 06:06:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Firefox running in KDE showing static text that is a bit too large (52.42 KB, image/png)
2009-05-27 19:42 UTC, gene smith
no flags Details
Konqueror (kfm) static text (native KDE) a bit smaller than GTK menus (16.94 KB, image/png)
2009-05-27 19:46 UTC, gene smith
no flags Details
Static fonts for gvim (on left) vs. kwrite. (5.73 KB, image/png)
2009-05-27 20:34 UTC, gene smith
no flags Details
Firefox and Konqueror (firefox using size 9, konqueror size 10) (38.80 KB, image/png)
2009-05-28 20:44 UTC, Mary Ellen Foster
no flags Details
fedora kde bug: wrong fonts in gtk apps (180.56 KB, image/png)
2009-08-07 20:16 UTC, Fdor
no flags Details
fedora kde bug solved with effort: wrong fonts in gtk apps (183.23 KB, image/png)
2009-08-08 07:52 UTC, Fdor
no flags Details

Description gene smith 2009-05-27 19:42:01 UTC
Created attachment 345668 [details]
Firefox running in KDE showing static text that is a bit too large

Description of problem:
Running firefox, gvim, thunderbird in KDE always results in the displayed font for static text (e.g., menus, tab text, static bookmarks) a step or two too large. It does not respond to KDE settings for "GTK Fonts and Style", KDE fonts, or DPI.


Version-Release number of selected component (if applicable):
KDE 4.2.3


How reproducible:
Always


Steps to Reproduce:
1. Run GTK based app in KDE
2. Observe static fonts are a bit large
3.
  
Actual results:


Expected results:
Expect GTK based apps to have same fonts as native KDE apps


Additional info:
See attachements for comparison between firefox and konqueror (as filemanager) static fonts.

Comment 1 gene smith 2009-05-27 19:46:49 UTC
Created attachment 345669 [details]
Konqueror (kfm) static text (native KDE) a bit smaller than GTK menus

There is not a big difference but it is noticable and there seems to be no way to adjust the static text size to make it match that of native KDE apps.

Note: this bug reported originated with discussion in bug 501427

Comment 2 Rex Dieter 2009-05-27 19:50:04 UTC
Shrug, I'll say the same thing as I did over there.

gtk/kde have different notions of dpi.  Once you perform that proper voodoo to make them match, font sizes are fairly equitable.

Oh, and ignore firefox for testing too, it hard-codes it's own notion of dpi as well (also at 96dpi, I believe).

Comment 3 Rex Dieter 2009-05-27 20:04:17 UTC
See my before and after setting 96dpi in systemsettings (using konq):

http://rdieter.fedorapeople.org/107vs96dpi.png

(My usual dpi according to xdpyinfo is 107)

Comment 4 gene smith 2009-05-27 20:32:31 UTC
Looks like mine is only 86 if am reading it right:
screen #0:
  dimensions:    1280x1024 pixels (376x301 millimeters)
  resolution:    86x86 dots per inch

So maybe mine won't go to 96 so I never see a difference ??

Anyhow, ignoring firefox and thunderbird for now I attached another example of the small difference I see in menu fonts between gvim (gtk based) and kwrite (native kde). Like I say, it is not a big difference.

Comment 5 gene smith 2009-05-27 20:34:09 UTC
Created attachment 345678 [details]
Static fonts for gvim (on left) vs. kwrite.

Comment 6 Rex Dieter 2009-05-27 20:47:14 UTC
OK, I can see small differences now.  (without setting 96dpi in kde it's even more pronounced).

Now, what to do about it?  There's huge fundamental differences in the text rendering stacks for qt vs gtk apps.  Who's right?  Who's wrong?

Comment 7 gene smith 2009-05-27 21:11:35 UTC
(In reply to comment #6)
> OK, I can see small differences now.  (without setting 96dpi in kde it's even
> more pronounced).
> 
> Now, what to do about it?  There's huge fundamental differences in the text
> rendering stacks for qt vs gtk apps.  Who's right?  Who's wrong?  

I don't know. I'm just reporting what I see on my isolated system :). Somehow this was never a problem (or noticeable) in my previous fedora8 with kde 3.5.x. 

FWIW, I have now booted into gnome and looking at kde apps there (such as konq, dolphin etc) and gtk based app (firefox, gvim, etc), they ALL have identical static menu fonts and look consistent with default settings. I would stay with that but I personally like KDE features better but many are now broken with 4.2.x it seems :(

I also have ubuntu KDE/gnome 9.04 and I think they had similar KDE problems and attempted to resolve it. I think they got the GTK apps in KDE to have smaller fonts but I don't think they look exactly right either. I will boot into that and take a look again.

Comment 8 Mary Ellen Foster 2009-05-28 20:36:37 UTC
Here's another example: konqueror and firefox running on my computer under KDE. I've set all fonts to 120dpi in the KDE configuration, and my native DPI is 147. According to my config, the menu font in Konqueror is Segoe UI 10, while I've selected Segoe UI 9 for GTK apps -- but if you look, the Firefox font is clearly bigger.

Another aspect of a similar problem is in bug 468451, where KDE titlebar/toolbar fonts are clearly using a different DPI than the fonts inside window contents. Forcing the KDE DPI does seem to ameliorate that issue, though.

Comment 9 Mary Ellen Foster 2009-05-28 20:44:01 UTC
Created attachment 345837 [details]
Firefox and Konqueror (firefox using size 9, konqueror size 10)

Oops, here's the actual picture ...

Comment 10 Rex Dieter 2009-05-28 21:19:04 UTC
Ignore fonts settings from gtk-qt-engine, when/if xsettings-kde is installed and in use, I believe it takes precedence.

Comment 11 Mary Ellen Foster 2009-05-28 21:33:05 UTC
It's weirder than that: based on a short experiment, firefox and thunderbird are unaffected by setting gtk-qt-engine fonts, but eclipse and OpenOffice.Org both follow the font that I set (haven't checked size though)

Comment 12 Mary Ellen Foster 2009-06-02 09:32:04 UTC
I've temporarily set a very distinctive gtk-qt font so that I notice when it is and isn't used. Here are a few more data points ...

While firefox and thunderbird seem to get their UI fonts from elsewhere, their print/save/open/etc. dialogue boxes (which I assume are standard GTK dialogues) *do* use the font from gtk-qt-engine. Also, while the tooltip and menus for nm-applet use the gtk-qt font, the "you are connected" popup window and the "connecting ..." tooltip use some other font.

How is this supposed to work?

Comment 13 Bug Zapper 2009-06-09 16:40:33 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 14 Steven M. Parrish 2009-07-22 11:55:42 UTC
Ping?

-- 
Steven M. Parrish - KDE Triage Master
                  - PackageKit Triager
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 15 Rex Dieter 2009-07-27 12:59:29 UTC
firefox fonts are "speshul".  But, any other gtk-based app not following these preferences indicates app bugs (imo, and all that).

Comment 16 Steven M. Parrish 2009-07-31 18:41:43 UTC
Rex, want to keep this open or close as NOTABUG?

-- 
Steven M. Parrish - KDE Triage Master
                  - PackageKit Triager
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 17 Fdor 2009-08-07 20:16:18 UTC
Created attachment 356705 [details]
fedora kde bug: wrong fonts in gtk apps

I've installed gtk-qt-engine packet, the results are:

- If I select a theme at "GTK styles and fonts" preferences, then the
theme is correctly applied (widgets are redered based on the 
selected theme).

- If I select a specific font at "GTK styles and fonts" preferences,
then it's ignored, and a big font is used. Same if I select 
"Use my KDE fonts in GTK applications".

I attach a screenshot with Firefox, GVIM, Dolphin and Preferences 
windows. As you can see:

- I've selected the "Clearlooks" Gnome theme as the theme for GTK
apps. And it's correctly applied in widgets (except, perhaps, the
toolbar icons at Firefox, that are from KDE, not from Gnome).

- I've selected "Sans Serif (size 9)" as the font for GTK apps (well,
you can see that "Use my KDE fonts in GTK applications" is selected,
but that is probably due to the fact that I've selected the same
font I have in KDE, so probably gtk-qt-engine detects that and then
automatically changes the selection). The efect is none. As you can
see, menu font (and the tab font) in GTK apps (Firefox, GVIM) are 
bigger than in QT apps (Dolphin, Preferences).

All my soft is up-to-date:

Fedora 11
kdebase-4.2.4-2.fc11.i586
kdebase-workspace-4.2.4-5.fc11.i586
gtk-qt-engine-1.1-5.fc11.i586

Comment 18 Rex Dieter 2009-08-07 20:23:07 UTC
Please use an app other than firefox as a gtk-app example, it's a hybrid xulrunner app (see comment #15).

Comment 19 Fdor 2009-08-07 20:46:59 UTC
#18 the screenshot also contains a GVIM window, that is a GTK-app. As you can see, the menu font in GVIM is also wrong.

Comment 20 Rex Dieter 2009-08-07 20:54:34 UTC
OK, now for scientific research why two different code bases gtk/cairo and qt result in fonts of different size, taking into account particular fonts (default dejavu) and whether dpi is used (both should these days), and then determine how best to accomplish that.

It'll likely take dicussion and collaboration from both camps.  Who's game to take the issue(s) at hand upstream?

Comment 21 Kevin Kofler 2009-08-07 21:07:26 UTC
Well, slight differences can probably be explained by the different text renderers (Pango vs. Arthur). With Pango getting HarfBuzz support (Qt already uses it), this might get fixed automatically. Unfortunately, that feature got postponed to Fedora 13. :-( I'm not sure whether the differences shown in this bug report are due to that, they seem to be in the range which might be caused by rendering differences. I'm seeing them myself, and what I figured out with some testing was that for Qt, the higher you turn the (auto)hinting, the smaller the font gets, for GTK+, the larger it gets. They seem to use different rounding algorithms to snap the curves to pixels. I hope HarfBuzz will fix this, too bad the feature was dropped from F12 (I was the only one against dropping it in the FESCo vote).

Massive differences, on the other hand, are almost certainly due to dpi setting issues. I've seen some screenshots with massive font size differences posted somewhere (I think it was the #fedora-kde chan).

So I think we have more than one issue.

Comment 22 Kevin Kofler 2009-08-07 21:09:36 UTC
(All the upstream work for a HarfBuzz-enabled Pango is done, it would just have been a matter of building a new Pango, but the other FESCo members said it's too risky to do this after feature freeze because nobody tested a HarfBuzz-enabled Pango in Rawhide yet, and HarfBuzz having been "tested" for months with Qt isn't good enough to show that HarfBuzz also works with Pango.)

Comment 23 Fdor 2009-08-08 07:52:55 UTC
Created attachment 356760 [details]
fedora kde bug solved with effort: wrong fonts in gtk apps

Finally I've got same font size both in gtk-apps and in qt-apps.
These are the steps I followed:

- See native dpi at Xorg.log:
    
    $ su -
    # grep -i dpi /var/log/Xorg.0.log
    (==) RADEON(0): DPI set to (96, 96)
  
  Since it has a "==", this means that it's default config, so it's
  the "native" dpi of my display. (correct?)(any other way to obtain
  the native dpi?)

- See the dpi used by gnome when redering fonts:
  - Boot gnome.
  - Go to menu > system > preferences > apparence ("look and feel" 
    in english?) > tipographs ("fonts" in english?) > details >
    resolution: xxx dpi
  - I had xxx=100 dpi, so I changed it to xxx=96 dpi (my native dpi).
    Fonts got a bit smaller in gnome, but they're still good.

- See dpi used by kde:
  - Boot kde.
  - Go to menu > machine > system preferences > aspect ("look and
    feel in english?) > fonts > force font dpi: xxx
  - I had xxx=disabled, so I changed it to xxx=96 (my native dpi)
    (other available option is xxx=120).
  - Fonts got too big, so I changed (at the same preference window)
    my font sizes from "Sans Seriff 9" to "Sans Seriff 8", to see a
    similar font size to the one I saw before. Additionally, I have
    "Sans 8" at gnome, so changing kde fonts to "Sans Seriff 8" 
    started to sound good.

- Reboot computer:
  - Boot kde again.
  - See results: It works!!! Fonts are the same (well, nearly the 
    same) both in gtk-apps and in qt-apps!!!

See attached screenshot with results.
  

Probably those are too much steps for a user.

I think gtk-qt-engine should do some (if not all) of those steps. 
The minimum feature would be to automatically check for the dpi 
coherence between gnome and kde, and show a warning if the're 
different, with instructions on how to change them. The ideal 
feature would be gtk-qt-engine to do all those steps automatically
(asking the user for confirmation first).

Comment 24 Sean Flanigan 2009-08-19 02:00:03 UTC
Thanks Fdor.  You can skip booting into gnome by running gnome-appearance-properties from the command line.  ("yum install control-center") 

gconftool-2 -t float --set /desktop/gnome/font_rendering/dpi 96

would probably work too (assuming you want 96 dpi). ("yum install GConf2")

Comment 25 Steven M. Parrish 2009-09-12 23:17:42 UTC
Rex what do you want to do with this one?

-- 
Steven M. Parrish - KDE Triage Master
                  - PackageKit Triager
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 26 Rex Dieter 2010-02-17 14:05:12 UTC
Anyone able to test with qt-4.6.x/kde-4.4.0 in updates-testing?  

I *think* it's better now, but I'd like some confirmation of that.

Comment 27 Rex Dieter 2010-02-17 14:08:42 UTC
See also bug #566136 mentioning qt-4.6.1 font sizes being a little larger now.

Comment 28 gene smith 2010-02-24 05:59:05 UTC
(In reply to comment #26)
> Anyone able to test with qt-4.6.x/kde-4.4.0 in updates-testing?  
> 
> I *think* it's better now, but I'd like some confirmation of that.    

I originally wrote this bug and just did a quick check between gvim, t-bird, kwrite and konq and now I *don't* see a noticeable difference. I am on kde 4.4 from updates-testing. Using same monitor and dpi as before. So, looks good to me.

Comment 29 Alexei Podtelezhnikov 2010-02-28 21:15:44 UTC
I suspect that the changes made in Qt-4.6.x to tweak the size also resulted in unfortunate bitmap font issues in bug 567987. The poor rendering of bitmap fonts only happens at small sizes there.


Note You need to log in before you can comment on or make changes to this bug.