OT: Buggy fonts

Duane Clark dclark at akamail.com
Mon Mar 25 22:26:31 CST 2002


Huw D M Davies wrote:
> A much better way to do font rendering in Wine is to use the new
> client side rendering code.  For this you need an XServer capable of
> supporting the RENDER extension (xdpyinfo will tell you whether you
> have such a beast) and a copy of the FreeType library version at least
> 2.0.5 (but the later the better).  Add a [FontDirs] section to your
> ~/.wine/config file, with entries pointing at any directories that
> contain TT fonts...

This got me to try out the client side rendering. It really does make 
the fonts (in MS Word in particular) not suck! Nice job. Guess I will 
stick with this configuration.

I came across two issues. The first is that virtually all dialogs and 
some windows were being drawn too narrow. The window/dialog height was 
normal. Looking at traces with and without the client side rendering, I 
saw this difference:

Server rendering:
trace:dialog:DIALOG_ParseTemplate32 DIALOG 0, 0, 287, 165, 0
trace:dialog:DIALOG_ParseTemplate32  STYLE 0x80c820c0
trace:dialog:DIALOG_ParseTemplate32  EXSTYLE 0x00000000
trace:dialog:DIALOG_ParseTemplate32  CAPTION L"Open"
trace:dialog:DIALOG_ParseTemplate32  FONT 8, L"helv", 0, FALSE
trace:font:WineEngCreateFontInstance L"System", h=16, it=0, weight=400, 
PandF=22, charset=0 orient 0 escapement 0
...
trace:font:XFONT_GetAvgCharWidth  retuning 6
trace:font:XFONT_RealizeFont physfont 3
trace:font:GetTextMetricsW text metrics:
     Weight = 400	 FirstChar = 0	 AveCharWidth = 6

Client rendering:
trace:dialog:DIALOG_ParseTemplate32 DIALOG 0, 0, 287, 165, 0
trace:dialog:DIALOG_ParseTemplate32  STYLE 0x80c820c0
trace:dialog:DIALOG_ParseTemplate32  EXSTYLE 0x00000000
trace:dialog:DIALOG_ParseTemplate32  CAPTION L"Open"
trace:dialog:DIALOG_ParseTemplate32  FONT 8, L"helv", 0, FALSE
...
trace:font:WineEngCreateFontInstance L"helv", h=-10, it=0, weight=0, 
PandF=00, charset=1 orient 0 escapement 0
...
trace:font:WineEngGetTextMetrics OS/2 winA = 1854 winD = 434 typoA = 
1491 typoD = -431 typoLG = 307 FT_Face a = 1854, d = -434, h = 2355: 
HORZ a = 1854, d = -434 lg = 67 maxY = 2124 minY = -665
trace:font:WineEngGetTextMetrics xAvgCharWidth 904 x_scale 20480 
tmAvgCharWidth 4
trace:font:GetTextMetricsW text metrics:
     Weight = 400	 FirstChar = 32	 AveCharWidth = 4

Suspecting the average char width, but not understanding the code that 
generates it, I cheated. In WineEngGetTextMetrics(), I added:
     if (ptm->tmAveCharWidth == 4)
         ptm->tmAveCharWidth = 6;

And this fixes all the dialogs and windows for me.

The other problem I ran across is shown in these pictures, showing 
server and client side rendering. My little hack above had no effect on 
this particular problem.
http://www.leewardfpga.com/server.png
http://www.leewardfpga.com/client.png

As can be seen, the vertical text is getting chopped off slightly.

The font with the problem is Tahoma, and this is with a ~/.wine/config 
that contains

[fonts]
"Resolution" = "96"
"Default" = "-adobe-times-"
"DefaultFixed" = "fixed"
"DefaultSerif" = "-monotype-times new roman-"
"DefaultSansSerif" = "-microsoft-tahoma-"






More information about the wine-devel mailing list