GNOME Bugzilla – Bug 726298
gtk-font-name isn't correctly handled on Windows
Last modified: 2014-03-28 13:12:54 UTC
Created attachment 271818 [details] The image showing garbled text for Arabic and Hebrew Hi, The commit 254d35af re-activates gtk-font-name handling, but unfortunately it isn't a fully-optimal solution as it breaks the handling of fonts that the system code page does not support. For example, as shown in the attached image, the Hebrew and Arabic texts in "Internationalization" under the "Text View" (or "Multiple Views") demo in gtk3-demo would show garbled/incorrect text, the Japanese text is displayed correctly on my Chinese (zh-TW) Windows 8 system.
Hi, Apparently this problem hits when one or both of the following are true: -The system is running Windows 8 -The setting for the language for non-Unicode programs differs from the language version of Windows (7 included, not sure about XP) that is running. I will try to investigate on this-this problem can be worked-around by deactivating the gtk-font-name handling, but probably better solutions exist. With blessings, thank you!
Created attachment 271832 [details] [review] Fallback to Pango for gtk-font-name handling on Windows if necessary Hi, I have come up with a patch to let the gtk-font-name handling fallback to using Pango (the behavior before the commit that re-activated handling gtk-font-name on Windows using Win32 APIs) when: 1. The program is running on Windows 8+ 2. The code page setting of non-Unicode programs does not match the language version of Windows that is running. The reason behind falling back to Pango in scenario 2 is because, if people are developing GTK+-3.x apps using Visual Studio on CJK versions of Windows, they need to set the code page of non-Unicode programs to English, so that the resulting code will build and run correctly. As we are close to 3.12 at this point, it would be greatly appreciated if this code can receive some feedback, and perhaps getting in, ASAP. With blessings, thank you!
Oh, by the way, I have tested this in the following systems: -Windows XP pro Chinese (Traditional), running in Windows 7 XP Mode -Windows 7 pro, Chinese (Traditional), with non-Unicode code page setting to English (US) and Chinese (Taiwan) -Windows 8.1 pro, Chinese (Traditional), with non-Unicode code page setting to English (US) and Chinese (Taiwan) ...and it seems that things are running fine in these parts at this point. With blessings, thank you!
Review of attachment 271832 [details] [review]: I'd rather have it handled with the win apis but in any case I guess we can push this for now.
Hello Ignacio, Thanks for the reviews, I have pushed the patch as 9e686d1f. With blessings, thank you-I will close this bug for now.