http://bugs.winehq.org/show_bug.cgi?id=16745
Summary: Create Option to Use Fontconfig for Handling Font Hinting and Replacement Product: Wine Version: 1.1.12 Platform: All OS/Version: other Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: gdi32 AssignedTo: wine-bugs@winehq.org ReportedBy: junk1112@new.rr.com
Created an attachment (id=18416) --> (http://bugs.winehq.org/attachment.cgi?id=18416) Patch to enable fontconfig hinting and replacements
This patch is an attempt to use fontconfig (specifically, what is defined in /etc/fonts and/or ~/.fonts.conf) to handle the hinting and replacements of fonts. This should allow the end user to make WINE programs appear more integrated with the rest of the desktop, if they choose to enable it.
The general idea is to inject the fontconfig data at the step in WineEngCreateFontInstance prior to opening the font face. This allows the GdiFont to be satisfied that it is getting the face it requested, and also rendering it the way fontconfig says to. This method still allows for the font replacement mechanism in WINE to work, as this works beneath it, not trying to compete with it. The fontconfig data and load flags for freetype are stored in tagGdiFont, and the load flags are then used in the rendering step. Also, Fontconfig initialization was brought out into a separate function, as fontconfig is now used in more than one place.
As I figured people may not want this on by default, it can be enabled by setting this DWORD registry key: HKCU\Software\Wine\Fonts\UseFontconfig = 1
If fontconfig is not available, the code is #ifdef'ed out, and if turned off in the registry (default), WINE uses its normal behavior.
I am not a bigtime C coder, and this is my first patch that deals with WINE, freetype, and fontconfig. So, there may be memory leaks that need fixing, as well as poor coding practices and errors. ;) I have not attempted to handle every type of configurable feature in fontconfig, just hinting and replacements, as those are the most major things. I am basically just a guy who wanted this feature hard enough to go about figuring out how to do it myself.
This patch is against freetype.c from 1.1.12. I welcome any suggestions and modifications to this patch, and info on how to get this into the development version of WINE.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #1 from Erik Johnson junk1112@new.rr.com 2009-01-02 22:50:06 --- Created an attachment (id=18417) --> (http://bugs.winehq.org/attachment.cgi?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. :)
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #2 from Erik Johnson junk1112@new.rr.com 2009-01-02 22:50:47 --- Created an attachment (id=18418) --> (http://bugs.winehq.org/attachment.cgi?id=18418) Sample 2 showing result
http://bugs.winehq.org/show_bug.cgi?id=16745
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #3 from Erik Johnson junk1112@new.rr.com 2009-01-03 00:44:19 --- There is an issue with fake italics in this patch. It was working with 1.1.10 but does not now. I am investigating.
http://bugs.winehq.org/show_bug.cgi?id=16745
Erik Johnson junk1112@new.rr.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #18416|0 |1 is obsolete| |
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #4 from Erik Johnson junk1112@new.rr.com 2009-01-03 12:47:45 --- Created an attachment (id=18432) --> (http://bugs.winehq.org/attachment.cgi?id=18432) A modified patch that fixes the fake_italic problem
http://bugs.winehq.org/show_bug.cgi?id=16745
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Platform|All |Other
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #5 from Erik Johnson junk1112@new.rr.com 2009-02-21 00:36:25 --- Seriously? Nobody thinks this is a totally awesome option that needs all kinds of further consideration of being included in the main Wine distribution? ;)
http://bugs.winehq.org/show_bug.cgi?id=16745
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|gdi32 |-unknown
--- Comment #6 from Dmitry Timoshkov dmitry@codeweavers.com 2009-02-25 01:07:04 --- This patch will break all the apps that rely on win32 API and registry settings to handle font hinting and substituting.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #7 from Erik Johnson junk1112@new.rr.com 2009-02-26 21:12:54 --- (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.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #8 from Dmitry Timoshkov dmitry@codeweavers.com 2009-02-27 02:59:06 --- (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.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #9 from Erik Johnson junk1112@new.rr.com 2009-03-17 20:50:14 --- 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.
http://bugs.winehq.org/show_bug.cgi?id=16745
Hin-Tak Leung htl10@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |htl10@users.sourceforge.net
http://bugs.winehq.org/show_bug.cgi?id=16745
Scott Ritchie scott@open-vote.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |scott@open-vote.org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #10 from Scott Ritchie scott@open-vote.org 2009-04-16 17:21:52 --- 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.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #11 from Dmitry Timoshkov dmitry@codeweavers.com 2009-04-16 22:00:57 --- (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).
http://bugs.winehq.org/show_bug.cgi?id=16745
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |integration
--- Comment #12 from Austin English austinenglish@gmail.com 2009-10-29 14:57:50 --- Still present.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #13 from Austin English austinenglish@gmail.com 2010-05-21 13:40:36 --- Fixed by http://source.winehq.org/git/wine.git/?a=commitdiff;h=922e15cbd04fde3d9d4fbb... ?
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #14 from Scott Ritchie scott@open-vote.org 2010-05-21 15:07:52 --- Does this cover http://bugs.winehq.org/show_bug.cgi?id=17148 too?
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #15 from Alexandre Julliard julliard@winehq.org 2010-05-21 15:21:41 --- Anti-aliasing should be handled now, font replacement isn't yet.
http://bugs.winehq.org/show_bug.cgi?id=16745
Zdeněk Kopřivík zdenek.koprivik@post.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zdenek.koprivik@post.cz
--- Comment #16 from Zdeněk Kopřivík zdenek.koprivik@post.cz 2010-05-27 08:40:43 --- (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.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #17 from Zdeněk Kopřivík zdenek.koprivik@post.cz 2010-05-27 09:06:49 --- 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.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #18 from Dmitry Timoshkov dmitry@codeweavers.com 2010-05-27 09:11:32 --- (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.
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #19 from Zdeněk Kopřivík zdenek.koprivik@post.cz 2010-05-27 09:28:07 --- (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.
http://bugs.winehq.org/show_bug.cgi?id=16745
rusivi rusivi1@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rusivi1@gmail.com
--- Comment #20 from rusivi rusivi1@gmail.com 2010-09-13 18:01:27 CDT --- Does this occur in newest WINE?
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #21 from butraxz@gmail.com 2013-03-04 14:47:37 CST --- This has not been updated for two years. Is this an issue in 1.5.25 or should this be closed as abandoned ?
http://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #22 from butraxz@gmail.com 2013-04-23 15:25:31 CDT --- No update for 900 days. Third query in a row. Plase close as abandoned
https://bugs.winehq.org/show_bug.cgi?id=16745
--- Comment #23 from Austin English austinenglish@gmail.com --- (In reply to butraxz from comment #22)
No update for 900 days. Third query in a row. Plase close as abandoned
Abandoned.
https://bugs.winehq.org/show_bug.cgi?id=16745
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |ABANDONED
--- Comment #24 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Austin English from comment #23)
(In reply to butraxz from comment #22)
No update for 900 days. Third query in a row. Plase close as abandoned
Abandoned.
https://bugs.winehq.org/show_bug.cgi?id=16745
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #25 from Austin English austinenglish@gmail.com --- Closing.