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

This reverts r72442 and restores the use of GenericTypographic string format
for GDI+ text rendering. While it's true that using this flag with small font
sizes results in pretty bad output, especially under Windows XP, not using it
results in wrong text extent calculations for all sizes which is even worse.

See #14537.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-09-30 20:35:56 +00:00
parent 5d83eee7dd
commit 669f031b94

View File

@@ -89,23 +89,15 @@ inline StringFormat* GetDrawTextStringFormat()
{
if ( !gs_drawTextStringFormat )
{
// We create this string format with exactly the same flags as
// StringFormat::GenericTypographic() is documented to use in MSDN
// except for the last one which doesn't make any difference for
// DrawText() but that we do want to use when measuring text.
//
// 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
(
StringFormatFlagsLineLimit |
StringFormatFlagsNoClip |
StringFormatFlagsNoFitBlackBox |
StringFormatFlagsMeasureTrailingSpaces
);
gs_drawTextStringFormat = new StringFormat(StringFormat::GenericTypographic());
// This doesn't make any difference for DrawText() actually but we want
// this behaviour when measuring text.
gs_drawTextStringFormat->SetFormatFlags
(
gs_drawTextStringFormat->GetFormatFlags()
| StringFormatFlagsMeasureTrailingSpaces
);
}
return gs_drawTextStringFormat;