wine does not respect font hinting or anti-aliasing settings

Bug #318478 reported by Alexander Jones
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Wine
Invalid
Undecided
Unassigned
wine (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: wine

Everything looks like Windows 2000.

Everything else on my system uses unhinted RGBA anti-aliasing, as specified in my system fontconfig settings. Whatever settings I choose, Wine programs use BCI-hinted, non-AA text at small sizes and greyscale AA text at larger sizes.

I have chosen "Sans" as the font for everything via winecfg but this only seems to affect the menu bars. Indeed, however, these menus are unhinted greyscale AA (even if they are incorrectly selecting the Condensed version of DejaVu Sans -- another bug.)

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: wine 1.1.0~winehq0~ubuntu~8.04-1
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: wine
Uname: Linux 2.6.28-4-generic x86_64
UnreportableReason: This is not a genuine Ubuntu package

Tags: apport-bug
Revision history for this message
In , Moony (junk1112) wrote :

Created an attachment (id=18417)
Sample 1 showing result

I am also using customized fonts (tweaked with fontforge), in case anybody is wondering why they don't look all crappy. :)

Revision history for this message
In , Moony (junk1112) wrote :

Created an attachment (id=18418)
Sample 2 showing result

Revision history for this message
In , Moony (junk1112) wrote :

There is an issue with fake italics in this patch. It was working with 1.1.10 but does not now. I am investigating.

Revision history for this message
In , Moony (junk1112) wrote :

Created an attachment (id=18432)
A modified patch that fixes the fake_italic problem

Revision history for this message
Alexander Jones (alex-weej) wrote :

Binary package hint: wine

Everything looks like Windows 2000.

Everything else on my system uses unhinted RGBA anti-aliasing, as specified in my system fontconfig settings. Whatever settings I choose, Wine programs use BCI-hinted, non-AA text at small sizes and greyscale AA text at larger sizes.

I have chosen "Sans" as the font for everything via winecfg but this only seems to affect the menu bars. Indeed, however, these menus are unhinted greyscale AA (even if they are incorrectly selecting the Condensed version of DejaVu Sans -- another bug.)

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: wine 1.1.0~winehq0~ubuntu~8.04-1
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: wine
Uname: Linux 2.6.28-4-generic x86_64
UnreportableReason: This is not a genuine Ubuntu package

Revision history for this message
Alexander Jones (alex-weej) wrote :
Revision history for this message
Flavio Tordini (zarlino) wrote :

Yes, please make Wine respect fontconfig settings. Anything that uses fonts on the Ubuntu Desktop should respect them.

Revision history for this message
In , Moony (junk1112) wrote :

Seriously? Nobody thinks this is a totally awesome option that needs all kinds of further consideration of being included in the main Wine distribution? ;)

Revision history for this message
In , Dmitry-codeweavers (dmitry-codeweavers) wrote :

This patch will break all the apps that rely on win32 API and registry
settings to handle font hinting and substituting.

Revision history for this message
In , Moony (junk1112) wrote :

(In reply to comment #6)
> This patch will break all the apps that rely on win32 API and registry
> settings to handle font hinting and substituting.
>

It shouldn't break anything, as least as far as I know. My understanding is that Windows knows nothing about the hinting, as that relates to freetype. I also made sure not to break existing substitution code in Wine.... if someone substitues Arial for Verdana using the Wine substitutions, and has fontconfig replaces Verdana with DejaVu, then the patch tells Wine "Here is Verdana", and proceeds to load and display DejaVu. So, I don't think it will break anything. Besides, it's not set up as a default... if someone wants to use it they enable it with a registry setting.

Revision history for this message
In , Dmitry-codeweavers (dmitry-codeweavers) wrote :

(In reply to comment #7)
> It shouldn't break anything, as least as far as I know. My understanding is
> that Windows knows nothing about the hinting, as that relates to freetype. I
> also made sure not to break existing substitution code in Wine.... if someone
> substitues Arial for Verdana using the Wine substitutions, and has fontconfig
> replaces Verdana with DejaVu, then the patch tells Wine "Here is Verdana", and
> proceeds to load and display DejaVu. So, I don't think it will break anything.
> Besides, it's not set up as a default... if someone wants to use it they
> enable it with a registry setting.

What happens if an app requests GGO_UNHINTED,NONANTIALIASED_QUALITY,
ANTIALIASED_QUALITY,CLEARTYPE_QUALITY and similar flags? Freetype's
autohinting is far not the same as the bytecode interpreted glyphs, and
Wine has enough problems due to the missing bytecode interpreter already.
Forcing anything the Linux distro developers think or a user sets on their
own is going to lead to all kind of hardly to debug/weird font rendering bugs.

Revision history for this message
In , Moony (junk1112) wrote :

Well, you may be right about what you are saying. I don't know enough to say otherwise. I don't really feel like going back and forth about it. The patch is here for anyone interested in using it or developing it further. I hope that eventually it can be put into the main Wine distribution, as I see no reason why it overrides any existing font settings in Wine, unless a user chooses to enable it.

Revision history for this message
In , Scott Ritchie (scottritchie) wrote :

Perhaps the patch isn't correct, but I'd like to confirm this as a problem. There's also a launchpad bug: https://bugs.launchpad.net/wine/+bug/318478

Basically, a user goes into their system, configures it to use font hinting a certain way, then opens up a program in Wine and finds that it isn't working.

How does Windows tell apps to use different font settings? I'm pretty sure Windows has a centralized control panel for this similar to the one for fonts already on the system.

Revision history for this message
In , Dmitry-codeweavers (dmitry-codeweavers) wrote :

(In reply to comment #10)
> Perhaps the patch isn't correct, but I'd like to confirm this as a problem.
> There's also a launchpad bug: https://bugs.launchpad.net/wine/+bug/318478
> Basically, a user goes into their system, configures it to use font hinting a
> certain way, then opens up a program in Wine and finds that it isn't working.

In order to enable hinting in Freetype it's necessary to recompile it.
Freetype doesn't have a run-time option to turn on/off hinting. And no,
bytecode interpreter and autohinter are different things in Freetype with
very different results.

> How does Windows tell apps to use different font settings? I'm pretty sure
> Windows has a centralized control panel for this similar to the one for fonts
> already on the system.

It's apps who tell what font attributes they would like to have.

http://www.winehq.org/pipermail/wine-devel/2009-March/074261.html
So it's OK to query the global antialiasing setting (on or off).

Changed in wine (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Changed in wine:
status: Unknown → Confirmed
Revision history for this message
In , Austin English (austinenglish) wrote :

Still present.

Revision history for this message
In , Austin English (austinenglish) wrote :
Revision history for this message
In , Scott Ritchie (scottritchie) wrote :
Revision history for this message
In , Alexandre Julliard (julliard) wrote :

Anti-aliasing should be handled now, font replacement isn't yet.

Revision history for this message
In , KOPRajs (zdenek-koprivik) wrote :

(In reply to comment #15)
> Anti-aliasing should be handled now, font replacement isn't yet.

The commit 922e15cbd04fde3d9d4fbb98600f5471420c2daa actually caused that my nice fonts became ugly in 1.2-rc1.
I'm not sure if I have something wrong in the fontconfig settings but my fonts are not aliased now on both my systems (Gentoo and Kubuntu).
I have hinting set in registry and it was working nice in 1.1.44.
Anyway there should be a way to force Wine to use manual hinting settings from the registry.

Relevant part in my registry:
[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingGamma"=dword:00000578
"FontSmoothingOrientation"=dword:00000001
"FontSmoothingType"=dword:00000001

Relevant part in my .fonts.conf:
  <edit mode="assign" name="rgba" >
   <const>none</const>
  ...
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  ...
  <edit mode="assign" name="hintstyle" >
   <const>hintmedium</const>
  ...
  <edit mode="assign" name="antialias" >
   <bool>true</bool>
  ...

The only way to get nice fonts back for me now is to edit the code and recompile Wine. Please make the fontconfig settings optional or add an option to force Wine to use manual settings from registry.

Revision history for this message
In , KOPRajs (zdenek-koprivik) wrote :

Here's what I get now:
http://jf-web.wz.cz/wine_fonts.png

I use Dejavu Sans as a replacement for Tahoma and MsDlg. In Wine 1.1.44 my fonts perfectly match to the rest of the desktop.

Revision history for this message
In , Dmitry-codeweavers (dmitry-codeweavers) wrote :

(In reply to comment #17)
> I use Dejavu Sans as a replacement for Tahoma and MsDlg.

Not related, but is there any reason you do that? Wine has a built-in Tahoma,
and some apps do depend on Tahoma font metrics to be the same as under Windows.

Revision history for this message
In , KOPRajs (zdenek-koprivik) wrote :

(In reply to comment #18)
> Not related, but is there any reason you do that? Wine has a built-in Tahoma,
> and some apps do depend on Tahoma font metrics to be the same as under Windows.

Simply because it looks nice and integrated with the desktop and I do not have problems with it.

Revision history for this message
In , rusivi2 (rusivi2-deactivatedaccount) wrote :

Does this occur in newest WINE?

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for posting this bug.

Does this occur in newest WINE?

Changed in wine (Ubuntu):
status: Triaged → Incomplete
Changed in wine:
importance: Unknown → Wishlist
Revision history for this message
In , Butraxz (butraxz) wrote :

This has not been updated for two years. Is this an issue in 1.5.25 or should this be closed as abandoned ?

Revision history for this message
In , Butraxz (butraxz) wrote :

No update for 900 days. Third query in a row. Plase close as abandoned

Revision history for this message
dino99 (9d9) wrote :

abandonned upstream

Changed in wine:
importance: Wishlist → Undecided
status: Confirmed → New
status: New → Invalid
Changed in wine (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.