views:

445

answers:

3

Hi.

I tried to find a similar question here, but found something different. I prefer to use display fonts smoothing in Windows, but I don't like the way how Windows XP smoothes the display font edges. Currently I use GDI++ that smoothes the display fonts making them look very similar to text rendered in Safari browser for Windows (as far as I know, not a Mac user, it's a native approach to MacOS). Great, GDI++ really renders the fonts very similar to Safari almost for all application I use, but I'm disappointed knowing that GDI++ does not (and can't?) support Visual Studio and Google Chrome. I guess these applications use somewhat another way to render the display fonts (just GDI O_o; and I guess they take into consideration Windows font edges smoothing settings [no smoothing, Standard or ClearType]), but I'm not sure and I'm not familiar with it. :(

Please clarify this to me. I'd really like to use GDI++ in Visual Studio and Google Chrome. Probably, someone uses some workarounds (sure, if it's possible). Thank you.

+2  A: 

This blog post by our esteemed benefactor is relevant. GDI+ indeed does things the Apple way, it uses true resolution independent rendering. It was pretty widely panned for this, so much so that it was replaced in .NET 2.0 with the TextRenderer class. Which uses the GDI DrawTextEx() function to draw text. To give an example of how GDI+ can suck, try running this sample Windows Forms form:

  public partial class Form1 : Form {
    public Form1() {
      InitializeComponent();
    }
    protected override void OnPaint(PaintEventArgs e) {
      e.Graphics.DrawString("Hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!", this.Font, Brushes.Black, 0, 0);
    }
  }

YMMV, but I haven't yet had a machine where that didn't look completely awful. TextRenderer saved the day.

Until .NET 3.0 when WPF was introduced. Back to resolution independent rendering. The amount of hate that generated was stunning.

Long story short, the majority of users like GDI text rendering. Or at least they get very vocal when they don't get it. Visual Studio and Chrome no doubt use GDI for text output. This is not something you can easily change yourself, although Chrome is open source afaik.

Just wait for the next version. Visual Studio 2010 will use WPF. Beta 1 generated a lot of hate for blurry text. But WPF has been tweaked to limit the fuzzies so it might not fit your taste anymore.

Hans Passant
Thank you, nobugz, for clarification. Let me ask you another question, please: Windows natively supports Standard and ClearType font smoothing styles only. Is it possible to use any other style (perhaps this would take some time for installation, etc) and eliminate the use of GDI++?
Lyubomyr Shaydariv
No. Font smoothing and pixel grid fit are two very different aspects of font rendering. Run ClearType Tuner on your machine to fix your problem. Ask more questions about it at superuser.com
Hans Passant
Thanks. The question is closed.
Lyubomyr Shaydariv
A: 

I've found the solution myself again. My GDI++ says the following in the "about" box:

Windows XP 5.01.2600 Service Pack 3
Screen: 1280 x 1024 x 32 bpp
GdiTray Version 1.0.2008.0927
GDI++.DLL Version 8.1.2008.1225
This software ONLY works on SSE2 capability processors.

Here is a part of the configuration file:

[UnloadDLL]
imejpmgr.exe
msdev.exe
devenv.exe

Commenting the "denenv.exe" with semicolon ";" and restarting the GDI++ makes the GDI++ apply font smoothing effects to Visual Studio:

[UnloadDLL]
imejpmgr.exe
msdev.exe
;devenv.exe

I'M REALLY HAPPY. :)

Lyubomyr Shaydariv
However, after a long time Visual Studio crashes if GDI++ is running with no any message boxes. :D Can't believe it. *CRAZY*
Lyubomyr Shaydariv
A: 

If it would be useful to web-designers and web-developers, etc: some users start Google Chrome with --no-sandbox command-line key. This key enables GDI++ support in Google Chrome. Take it for note.

Lyubomyr Shaydariv