http://bugs.winehq.org/show_bug.cgi?id=20420
Summary: VB6 Font size problem with custom usercontrols Product: Wine Version: 1.1.31 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: oleaut32 AssignedTo: wine-bugs@winehq.org ReportedBy: gabmoa@yahoo.it
Created an attachment (id=24231) --> (http://bugs.winehq.org/attachment.cgi?id=24231) Test VB6 wrong font size
There is an important issue with font size with VB6 applications.
I adjusted some VB6 applications from xp to linux using wine and the major problem consists of something wrong on saved font size.
The test application has a label with a tahoma 14 font and the same saved in a usercontrol with a property bag: in windows the two labels have obviously the same size but not in wine!
On load event font name and size are printed on the respective label: It seems the property value is right but font is not!
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #1 from Gabriele Moabiti gabmoa@yahoo.it 2009-10-19 09:41:43 --- Created an attachment (id=24232) --> (http://bugs.winehq.org/attachment.cgi?id=24232) Screenshot of the problem
http://bugs.winehq.org/show_bug.cgi?id=20420
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|oleaut32 |-unknown Severity|normal |minor
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #2 from Dmitry Timoshkov dmitry@codeweavers.com 2009-10-19 11:35:38 --- Does it help if you copy tahoma.ttf from Windows over a Wine one?
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #3 from Gabriele Moabiti gabmoa@yahoo.it 2009-10-19 12:09:53 --- (In reply to comment #2)
Does it help if you copy tahoma.ttf from Windows over a Wine one?
No. I have done some tests and the problem seems indipendent from font. (I think the importance may be normal because in some application I have tested the font is so small (it depends from fonts used) that it's not really usable)
http://bugs.winehq.org/show_bug.cgi?id=20420
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source
http://bugs.winehq.org/show_bug.cgi?id=20420
Valters Baumanis maxbetsoft@sveiks.lv changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |maxbetsoft@sveiks.lv
--- Comment #4 from Valters Baumanis maxbetsoft@sveiks.lv 2009-10-25 01:00:32 --- I've had the same problem with my VB6 online chat Rich Text Format (richtx32.ocx) text box. The bug occurs when you try to change the font at run-time using the object's font object property. (I'm currently using Wine 1.0.1, but I've seen it on previous versions too) There might be a chance to hack the bug somehow using Windows font API (that's my guess). But generally I solve it now by avoiding changing this "font" property at run-time, instead making out with just RTF selfontsize/selfontname properties... (I'd confirm the bug by changing the status to "New" if I could)
http://bugs.winehq.org/show_bug.cgi?id=20420
Gabriele Moabiti gabmoa@yahoo.it changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |oleaut32
--- Comment #5 from Gabriele Moabiti gabmoa@yahoo.it 2009-11-13 16:08:42 ---
With native oleaut32 the problem disappear so i have changed the component!
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #6 from Gabriele Moabiti gabmoa@yahoo.it 2009-11-13 16:54:46 --- (In reply to comment #5)
With native oleaut32 the problem disappear so i have changed the component!
... but native obvioulsy is not a solution (in some VB6 applications this bring to a strange error 372...)
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #7 from Valters Baumanis maxbetsoft@sveiks.lv 2009-11-14 07:36:44 --- Then it's very probable, that the Wine implementation of oleaut32 contains the bug (although I'm no Wine coder). I think, that the bug should be fixed even if it affects only the legacy VB6 apps, since there are many really good/useful VB6 apps, that people are using and will continue to use, that are too large and too complex to be upgraded to VB.net. And such combination as Wine+Linux might be the only ones to still support these Windows apps in future, since we already know Microsoft's statement not to support these apps beyond Windows7 OS. The fonts are so far the most buggy part I've seen in VB6 applications on Wine.
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #8 from Gabriele Moabiti gabmoa@yahoo.it 2009-11-17 16:32:20 --- I totally agree! ...and sometimes fonts are so tiny to be unreadable...
http://bugs.winehq.org/show_bug.cgi?id=20420
Brandon Myers darthbrandon@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #9 from Brandon Myers darthbrandon@gmail.com 2010-01-23 13:52:56 --- *** This bug has been confirmed by popular vote. ***
http://bugs.winehq.org/show_bug.cgi?id=20420
Brandon Myers darthbrandon@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |darthbrandon@gmail.com
--- Comment #10 from Brandon Myers darthbrandon@gmail.com 2010-01-23 14:01:32 --- I'm having this problem in the Total Extreme Wrestling series of games.
The font on several screens is displayed too small and it's difficult to read. However, when I switch to native oleaut32, the games become unstable and are prone to crashing where they had not before. I have screenshots of the text with both native and built-in if I need to post them.
It would be a huge benefit to have this fixed, as the crashes with the native oleaut32 make the games almost unplayable. These aren't "legacy" apps, either, as the new Total Extreme Wrestling 2010 is being released on Monday, with the pre-release demo already available.
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #11 from Brandon Myers darthbrandon@gmail.com 2010-02-06 14:56:56 --- Created an attachment (id=26089) --> (http://bugs.winehq.org/attachment.cgi?id=26089) FontProblem example running in Wine 1.1.38
This is the FontProblem example program running in Wine 1.1.38, using the ttf-tahoma-replacement package from the Ubuntu repositories and the builtin oleaut32.
The problem still exists, but the recent changes to the builtin oleaut32 seem to have worsened the font issues. I also tried running this program using a Wineprefix that had Tahoma installed via Winetricks, and other than a slightly smoother font for the larger line, it looks pretty much the same. The font seems to have lost its thickness, something that I also noticed in Total Extreme Wrestling 2010.
Native oleaut32 still displays the font with the normal size and thickness.
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #12 from Gabriele Moabiti gabmoa@yahoo.it 2010-02-20 19:34:35 --- I've tried to change the dirty bit in OLEFontImpl_Construct (dlls/oleaut32/olefont.c) in wine 1.1.39 and the example seems to work...
static OLEFontImpl* OLEFontImpl_Construct(const FONTDESC *fontDesc) {
...
/* * Initializing all the other members. */ newObject->gdiFont = 0; - newObject->dirty = TRUE; + newObject->dirty = FALSE; newObject->cyLogical = 72L; newObject->cyHimetric = 2540L;
...
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #13 from Gabriele Moabiti gabmoa@yahoo.it 2010-02-20 19:56:23 ---
I've done a mistake... Please ignore latest post! I agree with comment #10 for the "worsened"
http://bugs.winehq.org/show_bug.cgi?id=20420
Jeff Laughlin jeff.laughlin@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeff.laughlin@gmail.com
--- Comment #14 from Jeff Laughlin jeff.laughlin@gmail.com 2010-12-09 00:09:26 CST --- I'm seeing a similar issue, perhaps the same thing. I have a VB6 app with a TreeView and ListView, and the fonts are just microscopic. If I switch to the native oleaut32.dll, the fonts are normally sized.
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #15 from Jeff Laughlin jeff.laughlin@gmail.com 2010-12-09 04:53:52 CST --- Created an attachment (id=32421) --> (http://bugs.winehq.org/attachment.cgi?id=32421) Fixes this bug, I hope.
Fixes font scaling in oleaut32, and hopefully http://bugs.winehq.org/show_bug.cgi?id=20420.
The factors leading to tiny unreadable fonts include 1. Poor font selection in the first place. Please don't even try to use 8 or 9 point fonts. 2. Badly behaved Ole components that don't call SetRatio to set the screen resolution for the fonts they use. 3. olefonts.c hard coded a default screen resolution of 72 dpi.
The crux of this patch changes the hard coded default resolution in OLEFontImpl_Construct from 72 to 0 dpi. Apps that call SetRatio override this. Apps that dont, well the maths used to calculate the desired font size then calculates a font size of zero. Windows (or Wine) will not render a zero point font, but will select a reasonable size to use instead.
I have also revised the maths in realize_font() to operate as suggested in http://msdn.microsoft.com/en-us/library/dd145037%28v=VS.85%29.aspx
See also http://msdn.microsoft.com/en-us/library/ms691214%28v=VS.85%29.aspx
Tested on RHEL 6b2.
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #16 from Jeff Laughlin jeff.laughlin@gmail.com 2010-12-21 20:34:02 CST --- (In reply to comment #15)
Created an attachment (id=32421)
--> (http://bugs.winehq.org/attachment.cgi?id=32421) [details]
Fixes this bug, I hope.
Fixes font scaling in oleaut32, and hopefully http://bugs.winehq.org/show_bug.cgi?id=20420.
The factors leading to tiny unreadable fonts include
- Poor font selection in the first place. Please don't even try to use 8 or 9 point fonts.
- Badly behaved Ole components that don't call SetRatio to set the screen resolution for the fonts they use.
- olefonts.c hard coded a default screen resolution of 72 dpi.
The crux of this patch changes the hard coded default resolution in OLEFontImpl_Construct from 72 to 0 dpi. Apps that call SetRatio override this. Apps that dont, well the maths used to calculate the desired font size then calculates a font size of zero. Windows (or Wine) will not render a zero point font, but will select a reasonable size to use instead.
I have also revised the maths in realize_font() to operate as suggested in http://msdn.microsoft.com/en-us/library/dd145037%28v=VS.85%29.aspx
See also http://msdn.microsoft.com/en-us/library/ms691214%28v=VS.85%29.aspx
Tested on RHEL 6b2
Now that I think about it, instead of making the default zero, it might make more sense to just increase the default value from 72 to 96 or something, whatever is more typical for a modern display.
http://bugs.winehq.org/show_bug.cgi?id=20420
--- Comment #17 from Gabriele Moabiti gabmoa@yahoo.it 2011-01-18 11:20:17 CST ---
Now that I think about it, instead of making the default zero, it might make more sense to just increase the default value from 72 to 96 or something, whatever is more typical for a modern display.
Yes, It works fine!
http://bugs.winehq.org/show_bug.cgi?id=20420
Gabriele Moabiti gabmoa@yahoo.it changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #18 from Gabriele Moabiti gabmoa@yahoo.it 2012-03-30 08:18:14 CDT --- Fixed by commit 2ecbfbe5df0d7b5eb333f7723113c22ad171eacf
http://bugs.winehq.org/show_bug.cgi?id=20420
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |2ecbfbe5df0d7b5eb333f772311 | |3c22ad171eacf CC| |00cpxxx@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=20420
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #19 from Alexandre Julliard julliard@winehq.org 2012-03-30 13:34:39 CDT --- Closing bugs fixed in 1.5.1.