https://bugs.winehq.org/show_bug.cgi?id=46685
--- Comment #5 from Sagawa sagawa.aki+winebugs@gmail.com --- Created attachment 63828 --> https://bugs.winehq.org/attachment.cgi?id=63828 demonstrates WM_SETFONT margin settings with modified font.
The attachment contains Edit control test case, dlls/user32/edit.c replacement, and modified Wine's Tahoma font named TahomaMod.
TahomaMod has following glyphs: U+0041 - U+005A: ordinary `A' glyph. U+00FF: crafted `j', its left side bearing (LSB, aka A spacing in ABC) is -22. U+0100: ditto, LSB is -25. U+F8F3: ditto, LSB is -20. (CP932's \xff is converted into U+F8F3) and, MinLeftSideBearing in hhea table is -25.
Test case shows following output on native (Windows 10): edit.c:1683: TahomaMod(128): got 22, 3; expected 22, 3 edit.c:1688: TahomaMod(128): got 3, 25; expected 3, 25 edit.c:1718: TahomaMod(128): got 20, 3; expected 20, 3 edit.c:1723: TahomaMod(128): got 3, 25; expected 3, 25
Line 1683 shows WM_SETFONT's margins in Unicode Edit control. 22 seems to be opposite in sign to U+00FF's LSB. U+0100's value (25) isn't used. Line 1688 shows EM_SETMARGINS(EC_USEFONTINFO) margins in Unicode Edit control. 25 seems to be opposite in sign to MinLeftSideBearing value. Line 1718 shows WM_SETFONT's margins in ANSI variant. 20 seems to be \xff's LSB (opposite in sign). It's not U+00FF's. Line 1723 shows EM_SETMARGINS(EC_USEFONTINFO) margins in ANSI variant. They're the same as Unicode variant value.