Default margin in edit control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

By creating an edit control, EC_USEFONTINFO is used to set the controls
default right and left margin.

It seems that the default left, right margin is calculated in Wine by
using one third of the average char width. This is done for all Fonts.
Despite the docs don't tell how Windows calculates the default margins, my
tests show that the default right margin is different form the left margin
in most cases. So it can't be "one third of the average char width". Also
my tests show that for non TrueType or non vector fonts the default right
and left margin is set to zero. (Of course, because the horizontal
overhang is always zero then.)

Here are the docs describing the thing:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontroltextoperations.asp

"By default, the edit control margins are set just wide enough to
accommodate the largest character horizontal overhang (negative ABC
widths) for the current font being used in the edit control."

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_setmargins.asp

"The low/high-order word can specify the EC_USEFONTINFO value to set the
left/right margin to a narrow width calculated using the text metrics of
the control's current font. If no font has been set for the control, the
margin is set to zero."

My first patch fixes only the thing with the non TrueType fonts. A second
patch will follow when I have discovered how Windows calculates the
margins exactly.

Achim

Attachment: ecmargins.diff
Description: Binary data


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux