Don't use StringFormat::GenericTypographic() in MSW wxGraphicsContext.

Using this string format results in very condensed strings when using small
fonts. The results of GDI+ font rendering are still pretty bad even without it
but they are at least slightly better.

Closes #14537.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-09-09 00:43:40 +00:00
parent 122b3d0df3
commit dd9bafe129

View File

@@ -89,14 +89,22 @@ inline StringFormat* GetDrawTextStringFormat()
{ {
if ( !gs_drawTextStringFormat ) if ( !gs_drawTextStringFormat )
{ {
gs_drawTextStringFormat = new StringFormat(StringFormat::GenericTypographic()); // We create this string format with exactly the same flags as
// StringFormat::GenericTypographic() is documented to use in MSDN
// This doesn't make any difference for DrawText() actually but we want // except for the last one which doesn't make any difference for
// this behaviour when measuring text. // DrawText() but that we do want to use when measuring text.
gs_drawTextStringFormat->SetFormatFlags //
// The reason for not just using GenericTypographic itself is that it
// does something else (what exactly is unfortunately not documented),
// which results in string being displayed quite differently from the
// default rendering, see #14537.
gs_drawTextStringFormat
= new StringFormat
( (
gs_drawTextStringFormat->GetFormatFlags() StringFormatFlagsLineLimit |
| StringFormatFlagsMeasureTrailingSpaces StringFormatFlagsNoClip |
StringFormatFlagsNoFitBlackBox |
StringFormatFlagsMeasureTrailingSpaces
); );
} }