On Fri, Nov 15, 2002 at 03:25:48PM +0200, Shachar Shemesh wrote:
Hi all,
I am thinking of submitting the attached patch. The problem is that I am not comfertable with the location I added it.
As far as I could tell, there is nowhere in the whole of Wine where the selected language is matched with the charset to be used by default. This is what this patch comes to amend.
There is a slight awkwardness that is inherent to the Win32 API, in which, in order to create the default font, you zero out a LOGFONT struct, fill in the struct length, and call "CreateFontIndirect". Looking at the resulting struct, however, reveals that what you have just asked for is a ANSI_CHARSET font. It appears that windows correctly understands that this is an uninitialized LOGFONT, apparently based on the fields tested.
Hi,
CHARSET_DEFAULT is translated to the charset assosicated with the current ansi codepage in dlls/gdi/freetype.c:WineEngCreateFontInstance(). This of course only works if you're using client side rendered fonts (this becomes easier as of last night as you don't even need a RENDER capable XServer anymore). CreateFontIndirect is definitely the wrong place for these kind of fixups since GetOject on the hfont always returns the original logfont values. If you need to get this working for X11 fonts then you'll have to poke around in graphics/x11drv/xfont.c somewhere...
I hadn't spotted the brokenness of the Win32 API with regard to certain elements of logfont being set to zero giving a DEFAULT_CHARSET font. In fact it turns out that even if lfFaceName[0] != 0 then you still get this behaviour if the name doesn't match an installed fontname. The attached patch should fix this.
Huw.