Bug 17100 - XFree86 4 wrongly scales fonts
XFree86 4 wrongly scales fonts
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
Depends On:
  Show dependency treegraph
Reported: 2000-08-29 20:52 EDT by dbs
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-05-30 21:22:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
XFree86.0.log (25.79 KB, text/plain)
2001-04-26 10:17 EDT, dbs
no flags Details
XF86Config-4 (1.41 KB, text/plain)
2001-04-26 10:18 EDT, dbs
no flags Details
/etc/X11/fs/config (956 bytes, text/plain)
2001-04-26 10:19 EDT, dbs
no flags Details

  None (edit)
Description dbs 2000-08-29 20:52:52 EDT
Using XFree86-4.0.1-0.43 and a CT65555 card, TrueType and Type1 fonts are
scaled so that resx = 75 and resy = 100.   Other fonts (bitmapped?) are
unaffected.  The problem appears to be independent on whether the font
directories are in XF86Config or served from xfs, or whether the freetype
or xtt module (or neither) is loaded.

XFree86-SVGA-3.3.6-32 displays the fonts correctly when served from
XFree86-xfs-4.0.1-0.43.  Similarly, ftview shows the TrueType fonts

The problem also existed with the XFree86 4 from Pinstripe, viz.
Comment 1 Mike A. Harris 2001-03-10 01:08:30 EST
Does the problem still appear in XFree86-4.0.2-12.1 located at:
Comment 2 dbs 2001-03-11 20:26:02 EST
Problem still evident with XFree86-4.0.2-12.1, fonts served using xtt and
freetype modules and via xfs.
Comment 3 Mike A. Harris 2001-04-25 05:09:12 EDT
Please attach your X server log, XF86Config-4 and your /etc/X11/fs/config
using the link below.
Comment 4 dbs 2001-04-25 21:09:27 EDT
Problem seems to have gone away, now using XFree86-4.0.3-8 and
XFree86-xfs-4.0.3-8.  TrueType fonts, served from xfs, scale correctly.  *shrug*
Comment 5 dbs 2001-04-26 10:17:28 EDT
Created attachment 16488 [details]
Comment 6 dbs 2001-04-26 10:18:21 EDT
Created attachment 16489 [details]
Comment 7 dbs 2001-04-26 10:19:10 EDT
Created attachment 16490 [details]
Comment 8 dbs 2001-04-26 10:22:01 EDT
Sorry, I lie.  I restarted X and the problem reappeared as originally reported
(all scalable fonts, at least according to gfontsel) with X resolution of 75 and
Y resolution of 100, leading to vertically elongated characters/glyphs.

I've attached the logs you requsted.
Comment 9 Need Real Name 2001-05-19 18:58:02 EDT
I'm not the guy who logged the bug, and I don't have a service agreement, but I
just want to add for the record that I'm seeing this with a relatively clean (I
did install Ximian, but Ximian doesn't touch that stuff, and I see the same
thing if I use KDE) 7.1 install and a Matrox G450 card using the XFree86 mga
server and the beta mga.o driver from Matrox.  I also see the problem with the
stock XFree86 packages and the XFree86 from Mike Harris' test builds (4.0.3-14).

If I bring up gfontsel & select a TT font, it tells me that the Resolution X is
75, but the Resolution Y is 100, and if I bring up xfontsel and preselect a TT
font maker like Microsoft or Monotype, I can only choose those resolutions.

Interestingly enough, this problem was not seen before I upgraded the card from
a Voodoo3, so this appears (on the face of it) to be a problem that's revealed
only with certain drivers.
Comment 10 ben.de.rydt 2001-05-24 12:02:50 EDT
Same thing here. I'm using the stock RedHat XF86Config and /etc/X11/fs/config. 
I have a Matrox G200. Perhaps the problem is related to DPMS: XFree86 4.0.3 
detects my screen, and the physical dimensions of it. From this it deduces the 
dpi-setting of the display, as shown by xdpyinfo:

screen #0:
  dimensions:    1152x864 pixels (333x241 millimeters)
  resolution:    88x91 dots per inch

I didn't find how to set the dpi to another value.
Comment 11 Need Real Name 2001-05-24 23:34:18 EDT
I found a workaround! 

When I read  ben.de.rydt's comments, I noticed he is running at 1152x864.  I've
been running at the same resolution excusively for what seems like years.  I
changed the resolution to 1024x768 (telinit 3, edited XF86Config-4 by hand,
telinit 5) and the fonts are now showing properly at 75x75.  They're not
elongated any more.  Now, that's *all* I can choose in xfontsel, just as before
I could only choose 75x100, but at least this is reasonable.  xdpyinfo shows 
78x81 dpi.  

My guess is that the TrueType renderer is rounding off the dpi info to the
nearest value.  78x81's closest match would be 75x75, while it appears that it's
rounding 88x91 to 75x100.  If it's going to do that, it really should (IMO)
round so that the X and Y resolutions are identical.  I haven't tried other
resolutions (death before 800x600, even in the name of science). I'd be willing
to bet that a higher resolution  would result in 100x100 rendering.
Comment 12 Need Real Name 2001-05-24 23:40:22 EDT
Tested hypothesis -- at 1280x1024, the only TT resolution available is 100x100
-- I strongly suspect renderer is rounding the resolution and is non constrained
to keep the resolutions equal.
Comment 13 Juliusz Chroboczek 2001-05-30 11:52:43 EDT
Very weird.  I don't see how that can be due to X itself, I suspect it has to do
with the toolkit.

What happens if you specify a given resolution to xlsfonts -l?  Try:

  xlsfonts -l -fn '-monotype-arial-medium-r-normal--*-120-110-110-p-*-iso8859-1'

Comment 14 Need Real Name 2001-05-30 21:22:48 EDT
$ xlsfonts -l -fn
-->    0  255  some    0   34  16    4

However, if I do  this when running at 1152x864:

$ xlsfonts -l -fn '-monotype-arial-medium-r-normal--*-120-*-*-p-*-iso8859-1'
-->    0  255  some    0   34  12    3

Note that the default resolution displayed is 75 x100.  It's scaling it
correctly based on (my hypothesis) the best guess for the values xdpyinfo is

screen #0:
  dimensions:    1152x864 pixels (333x241 millimeters)
  resolution:    88x91 dots per inch

However, the fonts look much better when they're scaled proportionally in the X
and Y directions, especially in this case were one dimension is rounded up and
the other rounded down.  If this would give 90x90, I think we'd all be in better
Comment 15 Mike A. Harris 2001-07-16 03:18:10 EDT
If X cannot probe your monitor correctly then it won't scale fonts correctly
unless you specify the display width/height for dpi in the config file.
Comment 16 Need Real Name 2001-07-16 12:32:34 EDT
AFter playing with this somewhat, I agree that it's not a bug, it's a residual 
artifact resulting from the different ways X and TT fonts are designed to be 
used.  The fonts are scaling as correctly as they can be scaled.  X is probing 
the monitor correctly in these cases, but it seems to be able to handle only 
75dpi or 100dpi in the end.  This means that depending on the monitor 
resolution, you'll get 75x75dpi, 75x100dpi, 100x75dpi, or 100x100dpi.  (I've 
been able to generate each of these cases by tweaking the screen resolution.)

As the X fonts aren't available in the mixed-resolution case, they'll display 
in one or the other symmetrical resolutions, while the TrueType fonts will 
display in the asymmetrical resolution, creating the appearance that the TT 
fonts are "squished".

To fully "solve" this problem, X would need to support more symmetric font 
resolutions (80x80, 85x85, 90x90, etc. -- not a nice solution) or always round 
the screen resolution symmetrically (80x91 would go to 75x75 or 100x100 instead 
of 75x100 -- also not a good solution).  Tweaking the resolution itself or 
overriding DCC in the config file by specifying the DisplaySize (in millimeters 
in the Monitor stanza) seem to be the best solutions.

Thanks, folks!

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