Bug 55674

Summary: XFree86-4.1 and xfs badly render truetype fonts
Product: [Retired] Red Hat Linux Reporter: Leo Bergolth <leo>
Component: XFree86Assignee: Mike A. Harris <mharris>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: azeini, bradley.g.smith
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://leo.kloburg.at/x11-truetype/
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-02-06 04:58:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leo Bergolth 2001-11-04 15:34:13 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5) Gecko/20011012

Description of problem:
After upgrading from RH 7.0 to RH 7.2, truetype fonts were displayed badly.
It looks like they are horizontally condensed. I've verified that both
using xfs as font-server and using the freetype module of the xserver
without xfs.
The same fonts (I've tested it with Arial) worked without problems on RH
7.0. (XFree86-4.0.1-1) using the freetype module.

I've written a small script that displays a font in several sizes
(fontdisp) to be able to reproduce the bug. Screenshots of the output
(rh72-arial-xserver.png, rh72-arial-xserver.png) and the tested fonts can
be found at:
   http://leo.kloburg.at/x11-truetype/



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
(ttf-fonts are installed in /usr/local/share/fonts/truetype)

-----------------------------------------------
A) Using the freetype-module of XFree86-4.1.0-3
-----------------------------------------------

1) xset fp=
/usr/X11R6/lib/X11/fonts/misc:unscaled,/usr/X11R6/lib/X11/fonts/75dpi:unscaled,/usr/local/share/fonts/truetype
2) xset fp rehash
3) ./fontdisp
   or
   xfontsel -scaled -pattern "-monotype-arial-medium-r-*-*-*-*-*-*-*-*-*-*"
4) xwd | convert xwd:- rh72-arial-xserver.png



-----------------------------------------------
B) Using XFree86-xfs-4.1.0-3
-----------------------------------------------

1) xset fp= unix/:7100
2) xset fp rehash
3) chkfontpath 
   1: /usr/X11R6/lib/X11/fonts/misc:unscaled
   2: /usr/X11R6/lib/X11/fonts/75dpi:unscaled
   3: /usr/X11R6/lib/X11/fonts/100dpi:unscaled
   4: /usr/X11R6/lib/X11/fonts/misc
   5: /usr/local/share/fonts/truetype

4) ./fontdisp
   or
   xfontsel -scaled -pattern "-monotype-arial-medium-r-*-*-*-*-*-*-*-*-*-*"

5) xwd | convert xwd:- rh72-arial-xfs.png


Actual Results:  In both cases the results look horizontally condensed,
which becomes unreadable when using small font-sizes. An example screen
using mozilla is avaliable at:
   http://leo.kloburg.at/x11-truetype/rh72-mozilla-arial.png


Expected Results:  The results should look more expanded, I've created a
test-image rendered directly from the ttf-file using ftstrpnm from
freetype-utils:
   http://leo.kloburg.at/x11-truetype/ttf-arial.png
(The script that produces this image is ttfmontage.)

I'll produce a screenshot on RH 7.0 (where font rendering works) tomorrow.



Additional info:

I've already verified that there is no other font with the same name in my
fontpath.
The tested font (arial.ttf) comes from win2k, the output of ftdump
(freetype-utils) can be found at:
   http://leo.kloburg.at/x11-truetype/ftdump-arial.txt

Comment 1 Mike A. Harris 2001-11-05 13:35:33 UTC
Remove /usr/X11R6/lib/X11/fonts/misc from your font path, leaving only
the :unscaled version there.

One known cause for oddly scaled fonts, is if the X server cannot determine
the display dimensions properly.  Look at the XF86Config manpage, for the
"DisplaySize" option.  Try using that option to override this.

Does this change anything?


Comment 2 Leo Bergolth 2001-11-06 11:13:45 UTC
Thanks for your hint!
Adding the "DisplaySize" option to my "Monitor" Section fixed my problem.

Looks like the DPI settings were wrong. (Strange, I thought the default values
are 75x75 DPI?)
Maybe my screen resolution of 1152x864 confuses the X-server or my the nv
(Nvidia) driver querys the wrong EDID values from my Monitor (IBM P70)?
I've tried it on another RH 7.2 System with 1024x768, using the NVIDIA (not the
nv) driver from www.nvidia.com and it worked without the DisplaySize option...


Comment 3 Brad Smith 2001-12-01 22:31:10 UTC
I am also having similar font problems. I upgraded a system from RH 7.1 to RH
7.2 using the upgrade option. Many fonts displayed by Mozilla (0.95) show
exactly the same problems. For example, Nick Petreley's site www.varlinux.org
now displays with distorted fonts, whereas with RH 7.1 there were not any problems.

My font problems went beyond that however. After the upgrade completed and I
logged back into my account, all menu and display fonts in KDE were set to Arial
Black! The root account on this system still has that setting as nothing I do
seems to revert the fonts back to default.

Many KDE apps still display the Arial Black font for menus (e.g. kuser) and text. 

I sure could use some help fixing this. Will I have to do a clean install of RH
7.2? Instead of an upgrade?

Thanks,

Brad
bgsmith

Comment 4 Brad Smith 2001-12-06 03:28:13 UTC
As an additional note: I did try setting the DisplaySize option in the monitor
section of the config file. It had not effect that I could detect. The font
rendering of, say, varlinx.org is still off in much the same way as described by
Leo above.

Thanks,

Brad


Comment 5 William Sudderth 2002-01-06 04:58:40 UTC
Am experiencing the same problem. How should I determine the value for the
DisplaySize option, so that I can try it out?

Comment 6 William Sudderth 2002-01-06 06:55:52 UTC
Please ignore previous comment.  Found appropriate attributes for DisplaySize,
and it also corrected my "thin fonts" problem.  Not a terribly attractive
solution for an end-user, though.

Comment 7 Arash Zeini 2002-01-09 22:52:53 UTC
I have similar problems with truetype fonts. After an upgrade from 7.1 to 7.2 
nothing conncected with truetype fonts work anymore. I get wrong rendering and 
am not able to use them properly for writing documents. There seems to be a 
problem with UTF-8 too. I used to use Arial Unicode MS for viewing web pages in 
Farsi or other Unicode encoded pages. But since after the upgrade this is 
completley lost. I have had clean installs of 7.2 as well as updrages and the 
result is the same. This is crucial for example for our work on KDE's 
translation into Farsi. RH Linux 7.2 seems not to be useful in this regard.
Does anyone know where the problem could be and how to fix this?

Comment 8 Sarantis Paskalis 2002-02-05 13:49:16 UTC
A similar experience here.  A resolution of "1152x864" produces identical
results to those posted by <leo.ac.at>.  Adding the DisplaySize
option in /etc/X11/XF86Config-4 solves this.

Other resolutions however ("1024x768" and "1280x960" tested) render the fonts
correctly and do not need that tweaking.

Hardware:
Video Card: ATI Rage 128 PF
Monitor: Sony CPD G220 (17")

Comment 9 Mike A. Harris 2002-03-14 18:44:31 UTC
The DisplaySize option is the correct way to fix this.  It is viewed
as a workaround my some people, however X has no way of guessing a monitor's
dimensions if it can't probe them, other than just guessing.

In this case, manual configuration by using DisplaySize is necessary.