Wine fonts too big for their input fields.

Huw D M Davies h.davies1 at
Wed Apr 12 09:17:47 CDT 2006

On Tue, Apr 11, 2006 at 04:53:20PM -0700, Duane Clark wrote:
> Tony Lambregts wrote:
> >We now have at least three bugs[1] where the program will not accept the 
> >all the characters that are required if we do not use native fonts. The 
> >latest bug report was reported just today and the reporter resolved the 
> >bug as FIXED when he used Native fonts.
> >
> >So I have a couple of questions.
> >
> >Should we consider using native fonts a "FIX" or is it just a 
> >workaround? Or in other words can we fix our built in fonts to fix this.
> I also have an installer (for Xilinx) that exhibits this problem. I 
> created a small application that creates a single line edit control 
> (which is what the Xilinx installer uses). I notice that on Win2k the 
> EM_GETMARGINS message returns zero for left and right messages, but on 
> Wine it returns 2 for both margins.
> From a trace, the margins are getting set to 2 in EDIT_WM_SetFont(), 
> with the call:
> Commenting out that single line makes the Xilinx installer work fine. 
> Not that it is the correct fix ;)

I had some fun with this a month or two ago.  See the
test_margins_font_change test and calc_min_margin_size in the actual
code.  The deal seems to be that for 'small' edit controls
EC_USEFONTINFO results in no margin.  'Small' is currently defined to
be smaller than the extents of the (four character) string "'**'",
that's close but not quite how Windows does it.

Another interesting thing is that when it does set margins they are
often not symmetric left/right (although you tend to have to use
larger font sizes to see this) - it's presumably using some pair of
font metrics to set these and despite spending quite a while hunting I
drew a blank.

Now your problem could simply be that you don't have the font that the
app wants to use in this edit control.  It'll create the edit control
with a size that would work with that font under Windows (and probably
also under Wine), however if you don't have that font and Wine picks
one which ends up being slightly larger then you've got a problem.
It's difficult to know how to fix this.  The other possibility is that
you have the correct font but the '**' algorithm is slightly wrong (it
is) and that you're right on the edge of it kicking in.

Huw Davies
huw at

More information about the wine-devel mailing list