http://bugs.winehq.org/show_bug.cgi?id=7023
Summary: GetCharWidth implementation proposed improvements Product: Wine Version: unspecified Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-gdi-(printing) AssignedTo: wine-bugs@winehq.org ReportedBy: richardvoigt@gmail.com
I've got a game missing a lot of text because of repeatedly hitting stubs for GetCharWidthI, so I thought I'd try to implement it. This bug is for me to ask questions about the wine font engine, and my eventual patch.
First up, is it just me, or is the complexity of GetCharWidth32A totally pointless? Since every character is cast to (BYTE), it's restricted to single-byte characters, which makes the memory allocation, string building, and call to FONT_mbtowc all of no benefit, because all 8-bit characters map directly into UNICODE... or no?
I think the whole body of GetCharWidth32A can be replaced by BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar, LPINT buffer ) { return GetCharWidth32W(hdc, (BYTE)firstChar, (BYTE)lastChar, buffer); }