Closed Bug 181053 Opened 22 years ago Closed 22 years ago

[gtk2] mozilla can not aware the font setting in gnome theme

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: iamawalrus, Assigned: blizzard)

References

Details

Attachments

(1 file)

While using the theme "LargePrint", mozilla does not change its font size after
restart.

It could be a regression of bug 176842 . In gtkrc of LargePrint, the
gtk-font-name is "san 18", but in this function
  nsresult
  nsSystemFontsGTK::GetSystemFontInfo(GtkWidget *aWidget, nsFont* aFont,
                                      float aPixelsToTwips) const
  {
    GtkSettings *settings = gtk_widget_get_settings(aWidget);

    aFont->style       = NS_FONT_STYLE_NORMAL;
    aFont->decorations = NS_FONT_DECORATION_NONE;

    gchar *fontname;
    g_object_get(settings, "gtk-font-name", &fontname, NULL);
the fontname is always what I set in the control-center which is "san 12". Could
it be the problem?
It's reading that from the gtk settings.  If the gtk settings still say "sans
12" then that's what is going to be read.

How do other gnome apps pick up that setting?  Is it not part of the standard
gtk settings?

And it's certainly not a regression since we never used to read the proper gtk
settings at all. :)
Attached patch patchSplinter Review
How about this? With this patch, mozilla can aware the changing of font size
with theme changed.

r=?
Attachment #107005 - Flags: review?(blizzard)
Themes aren't allowed to set fonts.  The LargePrint theme is busted.  I'm not
taking this patch.  If you have a recent gtk version you can put this in your
~/.gtkrc:

gtk-font-name="Sans 24"
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → WONTFIX
Comment on attachment 107005 [details] [diff] [review]
patch

blizzard- on the patch
Attachment #107005 - Flags: review?(blizzard) → review-
oops.
The "LargePrint" theme is an accessibility feature. I agree that it is busted
that font could be set in two places. It is ambiguous. But the fact is that the
other gtk2.0 application changes font size except mozilla.
Doesn't gtk ignore gtkrc for the theme name and override with XSETTINGS?
point being, why are font name and theme name done different in gtk, if they are.
hp,

what do you mean by 'theme name'? I can not quite understand what you said in
above comments.
It really is all irrelevant. 

Setting the font in the theme is *wrong*; it is simply not a legitimate
use of the GTK+ theme format. While GTK+ doesn't currently ignore these
font sizes, I may change it to do so in a future release.

The way that the LargePrint theme works currently causes various very
obvious bugs in the GNOME desktop. For instance, the font selected 
in the font properties dialog will simply be ignored.

Plus, it will never properly interoperate with non-GTK+ applications which
form an integral part of the free software desktop. XSETTINGS is an
emerging standard for propagating settings across different applications.

The way large fonts are set by the accessibility themes needs to be fixed; a 
hack around in mozilla to make it follow large fonts set the wrong way would 
be a serious mistake.
ccing Bill Haneman to see what he will say...
owen: it may be "wrong" but as I have pointed out it's in the public API for the
RC files for GNOME-2.  It is also the only way of meeting our current
accessibility needs, as you are well aware.

When we have a theme-set mechanism that supports the specification of the
XSETTING for font in the theme-set index file *and* allows specification of the
icon-size XSETTING at the same time, then we can as you recommend remove the
font setting from the RC files, and in fact we would remove the icon-size string
as well.  This is however one more reason why jrb needs to allow inclusion of
the font in the index file (he has suggested a binary "large-print" toggle
instead, which would not in our view be satisfactory).

Note that without font, the icon-size setting in RC files is considerably less
useful, so as I say these should be migrated together, but only after a suitable
alternative mechanism via the ThemeSet API and UI is available.

I request that this bug be REOPENED until and unless the issues listed above
which require the current RC-file font specification are resolved.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: