Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

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.

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.

I tested that website in about 100 browsers / OSes combinations thru an online service called browsershots.org. 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.

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:

Code:

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.

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

Quote:

Originally Posted by lisle2011

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.