dirtyepic ([info]psykil) wrote,
@ 2008-04-30 11:34:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:gentoo

Why mozilla needs a freedesktop.org liason
So I finally got fed up with fonts on half the sites i visit (including LJ) being gargantuan in Firefox 3. I managed to track it down to this bug [https://bugzilla.mozilla.org/show_bug.cgi?id=384090].

Yay, it's fixed!

Then I read this gem:

"Well, the correct way to set font DPI on the Linux desktop is with the
/desktop/gnome/font_rendering/dpi gconf key."


*sigh*




(Post a new comment)


[info]psykil
2008-04-30 05:47 pm UTC (link)
yes, i misspelt gnome in my reply. i'm so ashamed.

(Reply to this)


[info]psykil
2008-04-30 06:53 pm UTC (link)
PS - I solved the problem by setting layout.css.dpi to 96 in about:config, as mentioned in the bug, so it's not a total loss.

(Reply to this) (Thread)

Gnome way of setting fonts
(Anonymous)
2008-04-30 11:46 pm UTC (link)
Go to:
System -> Preferences -> Appearance -> Fonts -> Details

Top left corner has a DPI.

This changes all of Gnome too, however.

(Reply to this) (Parent)(Thread)

Re: Gnome way of setting fonts
[info]psykil
2008-05-01 02:10 am UTC (link)
Heh. The point I was making is that I don't use Gnome. Therefore, while "fixing" Firefox to read the DPI from gconf works great for Gnome users, the rest of us are left hanging.

(Reply to this) (Parent)


(Anonymous)
2008-04-30 10:01 pm UTC (link)
this is so stupid.

There are a lot of ways to get the right DPI - starting with xdpyinfo.

Not everybody uses gnome - and a lot of people who don't use gnome don't want their system cluttered with useless gnome-crap just because the mozilla guys are too stupid to use standard tools.

Somebody needs to beat them with the cluehammer 80 000 (kg).

(Reply to this) (Thread)


[info]other_tetromino
2008-05-02 06:41 am UTC (link)
The basic issue is that *screen DPI* and *font DPI* on high-resolution displays are usually completely different numbers.

xdpyinfo gives you the screen DPI; the Xft/DPI XSETTINGS gives you the font DPI. The firefox bug was caused by firefox using the screen DPI (i.e. xdpyinfo) in some places where it should have been using the font DPI instead.

(Reply to this) (Parent)

mea culpa
[info]other_tetromino
2008-05-02 06:33 am UTC (link)
I made that comment about "the correct way to set font DPI". And I was wrong; at the time, I did not know better.

Now, let me explain the real story of how font DPI is set on the Linux desktop. The whole thing is done through a weird mechanism known as XSETTINGS. First, you need to be running a program called an XSETTINGS manager; in GNOME, this role is played by gnome-settings-daemon, KDE probably has something similar. The XSETTINGS manager places a hidden window on every screen of your X display. The hidden windows are marked as owners of a special X selection; the one for screen 0 owns the _XSETTINGS_S0 selection, etc. Then any time some program wants to render some text and needs to check for font DPI, it looks for the XSETTINGS manager's hidden window, reads and parses that window's _XSETTINGS_SETTINGS property, and looks for the Xft/DPI field (which contains the font resolution, in units of milliDPI).

The Gtk+ way of getting at this information is

gtk_settings_get_for_screen(screen);
dpi = gdk_screen_get_resolution(screen);

See http://standards.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html for the gory details of XSETTINGS specification.

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…