-   Linux - Software (
-   -   Same font in 2 machines - huge difference in aspect (

romagnolo 03-15-2012 05:28 PM

Same font in 2 machines - huge difference in aspect
I have installed a font called Rufscript from Debian's repos onto two distinct Debian computers nearly in the same software condition (Debian squeeze).
I'm experiencing huge difference in font rendering outcome between these computers; for any given font size, the same text string is always rendered a 20% larger on system A in terms of covered pixels.
I tested this using exclusively the screen/monitor of system A, bridging video output of computer B to A via ssh; the programs involved are Firefox (Iceweasel) and Gimp.
The font version and subversion are the same in A and B. Computer B is headless and doesn't have X server.

This also happens when computer A connects to a webserver in B which sends back a custom page featured with that font: on A, the browser shows the font bigger, no matter if it's set to accept custom text sizes from websites, while, opening the same browser in B via ssh, the font appears smaller, as it should.

I have no idea in what is involved is font rendering nor how I can predict those differences. The problem is particularly relevant since I'd like to use custom fonts for a public website.

lisle2011 03-15-2012 11:18 PM

Custom Fonts
Custom Fonts in a web server will not work for everyone as you are discovering, the apparent size of the font is influenced by many factors, screen size, screen attributes and the font file itself.

Many web servers with fancy fonts have already turned that text into graphic images so it displays more or less the same from web browser to web browser, you only have to look at almost any web page using each one of IE, FireFox, Opera and on and on. The differences are sometimes unbelievable. This leads web designer to be very careful in the choices they make to reach the right audience. I realize that this isn't what you want to read but it's the nature of the beast.

romagnolo 03-16-2012 12:20 PM

I tested that website in about 100 browsers / OSes combinations thru an online service called In all those browsers which support html 5 (and therefore custom fonts) the text size was correct, with the same exact dimension as shown by a browser running directly on the webserver. For all the tests, a same text string as been laid upon an image of determined size, having both the same (expected) length. The results showed an overall perfect image/text size match, leaving Opera the only browser to render slightly shorter texts. All Firefox starting from version 3 and newer Chrome had a correct rendering. So I suspect this isn't a widespread trouble but rater one just of my mine.

lisle2011 03-17-2012 07:19 PM

Font Size Differences
So having assured yourself it is not a browser issue that leaves the web server or the operating system.
Can you give me some more information on these two items.

It does seem that the server with the larger font is reacting to an aspect ratio; which is rather odd to me.

I'll help you all I can if I can get some better grip on the problem.

romagnolo 03-17-2012 09:38 PM

Doubts are all round my head. I'm strongly leaned toward an operating-system-wide trouble since more than one software I tested is affected by bigger fonts: browser and Gimp.
I tried to shrink the set of possible causes: since I run a custom back-port of kde3 that doesn't seem to have any control panel for fonts configuration, my only hook was to manipulate those X files in /etc/X11/Xresources/ and append to them a config line of the type:

Xft.dpi: 96.0
and after altering that 96.0 to other values, I started to notice font changes in all the desktop.
The Xft should be the font server for GTK-based applications; the role it showed to play was to enlarge or shrink the font sizes of all software's window menus and buttons, that is, all what structures the upper part of program's windows, but it had no effect at all on the texts contained inside those windows, so that browser (and Gimp) showed exactly the same result.
This should mean it is not a GTK-rendering problem.

Given that was my only hook, I installed the XFCE4 desktop environment aiming to access its fonts control-panel. But then, it had the same exact effects as modifying the earlier Xresources files; This should mean xfce4 control panel acts on fonts thru GTK's render, rather than on some other render.

Other renders still to test are the X core one and the Java one. These at least are all what I know about font rendering. I have no idea however if Iceweasel (Firefox) or Gimp actually use those system renders or incorporate one of their own.

romagnolo 03-18-2012 07:22 PM


Originally Posted by lisle2011 (Post 4629402)
So having assured yourself it is not a browser issue that leaves the web server or the operating system.

How could the webserver be related? It only sends a plain html 5 page with the font referenced in css, and all the layout elaboration is done on the user agents side, since there is no kind of active code executed by the server side, that is, it sends a plain static page


Originally Posted by lisle2011 (Post 4629402)
Can you give me some more information on these two items.

Webserver (running on computer I named B) is lighttpd daemon with no special configuration.
Operating system (computer A) is Debian 6 squeeze with all packages installed from that repository, apart a backport of kde 3.5 installed in a dedicated directory, but again that's just a regular kde with no special customization.
It has no much more installed software than Iceweasel, Gimp and a pdf-viewer.

All times are GMT -5. The time now is 11:58 PM.