http://bugs.winehq.org/show_bug.cgi?id=28443
Summary: MsiGetFileVersion fails when run on TrueType/OpenType font files Product: Wine Version: 1.3.28 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msi AssignedTo: wine-bugs@winehq.org ReportedBy: sam@robots.org.uk
Created an attachment (id=36468) --> (http://bugs.winehq.org/attachment.cgi?id=36468) vertest.tar.gz
When run on Windows, the attached test case prints:
$ '\leela\sam\src\vertest\vertest' '\leela\sam\src\vertest\vollkorn.otf' 1.800.0.0
When run under Wine, the call to MsiGetFileVersion fails:
$ WINEDEBUG=+msi wine vertest.exe vollkorn.otf trace:msi:MsiGetFileVersionW L"Vollkorn.otf" 0x130248 1024 (nil) 0 MsiGetFileVersionA error: 1
N.B., ERROR_INVALID_FUNCTION (1) is not listed as a valid return code for MsiGetFileVersion http://msdn.microsoft.com/en-us/library/aa370122(v=vs.85).aspx.
This causes WiX to create faulty MSI files, since it is unable to correctly extract version information from TrueType/OpenType font files.
http://bugs.winehq.org/show_bug.cgi?id=28443
Sam Morris sam@robots.org.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #1 from Austin English austinenglish@gmail.com 2011-09-20 14:01:47 CDT --- Should be fixed by http://source.winehq.org/git/wine.git/commitdiff/2788a95c8eeae8ce9e03762ff9b...
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #2 from Hans Leidekker hans@meelstraat.net 2011-09-20 14:56:45 CDT --- It's fixed for TrueType fonts. I have another patch for OpenType/CFF fonts.
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #3 from Sam Morris sam@robots.org.uk 2011-09-21 08:05:43 CDT --- There are some discrepancies between the output of vertest when run on Windows, and when run on Wine with the commit in comment 1:
windows wine Caudex-BoldItalic.ttf 1.1.0.0 1.01 .0.0 Caudex-Bold.ttf 1.1.0.0 1.01 .0.0 Caudex-Italic.ttf 1.1.0.0 1.01 .0.0 Caudex-Regular.ttf 1.1.0.0 1.01 .0.0 Cheboyga.ttf 4.1.0.0 4.1 30.06.1995 DroidSans-Bold.ttf 1.0.0.0 1.00.0.0 DroidSansFallback.ttf 2.0.0.0 MsiGetFileVersionA error: 1 DroidSansMono.ttf 1.0.0.0 1.00.0.0 DroidSerif-BoldItalic.ttf 1.0.0.0 1.00.0.0 DroidSerif-Bold.ttf 1.0.0.0 1.00.0.0 DroidSerif-Italic.ttf 1.0.0.0 1.00.0.0 DroidSerif-Regular.ttf 1.0.0.0 1.00.0.0 MutantA-MediumOblique.ttf 1.0.0.0 1.0 2006-11-09.0.0
I'll attach the font files in a moment. They are freely-distributable so don't worry about the licensing.
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #4 from Sam Morris sam@robots.org.uk 2011-09-21 08:06:25 CDT --- Created an attachment (id=36488) --> (http://bugs.winehq.org/attachment.cgi?id=36488) Caudex-Regular.ttf
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #5 from Sam Morris sam@robots.org.uk 2011-09-21 08:07:01 CDT --- Created an attachment (id=36489) --> (http://bugs.winehq.org/attachment.cgi?id=36489) Cheboyga.ttf
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #6 from Sam Morris sam@robots.org.uk 2011-09-21 08:14:36 CDT --- Created an attachment (id=36490) --> (http://bugs.winehq.org/attachment.cgi?id=36490) DroidSans-Bold.ttf
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #7 from Sam Morris sam@robots.org.uk 2011-09-21 08:15:16 CDT --- Created an attachment (id=36491) --> (http://bugs.winehq.org/attachment.cgi?id=36491) MutantA-MediumOblique.ttf
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #8 from Sam Morris sam@robots.org.uk 2011-09-21 08:16:42 CDT --- DroidSansFallback.ttf is too large to attach; you can find it at https://robots.org.uk/stuff/DroidSansFallback.ttf.
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #9 from Austin English austinenglish@gmail.com 2011-09-21 13:38:10 CDT --- (In reply to comment #2)
It's fixed for TrueType fonts. I have another patch for OpenType/CFF fonts.
http://source.winehq.org/git/wine.git/commitdiff/83ef90789fe3c41a6ed9925aa6f...
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #10 from Hans Leidekker hans@meelstraat.net 2011-09-22 02:06:45 CDT --- Created an attachment (id=36505) --> (http://bugs.winehq.org/attachment.cgi?id=36505) Improve font version parsing.
This patch should fix these, except for DroidSansFallback, which has an empty version string.
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #11 from Sam Morris sam@robots.org.uk 2011-09-22 05:18:49 CDT --- Great, those three patches fix everything except DroidSansFallback.ttf.
I don't know about the details of the TrueType format, but if I open that font in gnome-font-viewer it says "Version 2.00" in the Version field, so the data is in there somewhere...
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #12 from Sam Morris sam@robots.org.uk 2011-09-22 06:25:48 CDT --- Created an attachment (id=36511) --> (http://bugs.winehq.org/attachment.cgi?id=36511) League_Gothic.otf
One more test case: windows reads this font file's version as "0.0.0.0"; on Wine, MsiGetFileVersion returns 1. gnome-font-viewer does not list version information when opening the file, so I think this one actually lacks version information, as opposed to DroidSansFallback.ttf.
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #13 from Hans Leidekker hans@meelstraat.net 2011-09-22 06:54:51 CDT --- (In reply to comment #11)
Great, those three patches fix everything except DroidSansFallback.ttf.
I don't know about the details of the TrueType format, but if I open that font in gnome-font-viewer it says "Version 2.00" in the Version field, so the data is in there somewhere...
DroidSansFallback appears to store the version as a double byte string, in all the others it's stored as a single byte string.
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #14 from Sam Morris sam@robots.org.uk 2011-09-22 07:19:50 CDT --- Well spootted. The other font files seem to have the version string both in single-byte and multibyte encodings. I edited only the single-byte encoded version of DroidSans-Bold.ttf and found that Wine picked up the changes, but Windows did not. So Wine should probably always use the double-byte encoded strings.
I don't know enough to be able to remove one or other of the version strings, so I don't know what Windows does when only a single-byte encoded version string is present.
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #15 from Hans Leidekker hans@meelstraat.net 2011-09-22 08:31:09 CDT --- (In reply to comment #14)
Well spootted. The other font files seem to have the version string both in single-byte and multibyte encodings. I edited only the single-byte encoded version of DroidSans-Bold.ttf and found that Wine picked up the changes, but Windows did not. So Wine should probably always use the double-byte encoded strings.
I don't know enough to be able to remove one or other of the version strings, so I don't know what Windows does when only a single-byte encoded version string is present.
MsiGetFileVersion fails on Windows if there's no double-byte version string. I'll send a patch to make Wine use double-byte strings only.
http://bugs.winehq.org/show_bug.cgi?id=28443
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #16 from Hans Leidekker hans@meelstraat.net 2011-09-23 11:27:22 CDT --- Should be fixed by 19a965f581f719dce00c30294856b4804490bf69 and ca741823ddb404d8b11131bca674e9791376a8e2.
http://bugs.winehq.org/show_bug.cgi?id=28443
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #17 from Alexandre Julliard julliard@winehq.org 2011-09-23 12:59:24 CDT --- Closing bugs fixed in 1.3.29.
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #18 from Sam Morris sam@robots.org.uk 2011-09-26 10:32:26 CDT --- Confirming this is fixed in 1.3.29. Thanks for the great response! :)
http://bugs.winehq.org/show_bug.cgi?id=28443
--- Comment #19 from Hans Leidekker hans@meelstraat.net 2011-09-26 11:57:12 CDT --- (In reply to comment #18)
Confirming this is fixed in 1.3.29. Thanks for the great response! :)
Thanks for the great test cases!
http://bugs.winehq.org/show_bug.cgi?id=28443
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |ca741823ddb404d8b11131bca67 | |4e9791376a8e2