Textrenderinghint=antialiasing does not work with metafile

Posted on 2009-05-14
Last Modified: 2012-06-21
I created a metafile containing a chart in I set the TextRenderingHint to AntiAlias. When I display the metafile, the text quality is very poor. If I use the FillRectange to fill the bounds of the chart to White, the text looks great. Unfortunately, I cannot always fill the background with white. Is there an alternative way to display the metafile so the text looks good?
Question by:JerryHintze
  • 4
  • 2
LVL 39

Expert Comment

ID: 24390514
Did you use ImageFormat.Wmf? Because that's the old (from windows 3.0, 16 bit) format. The format you are probably after is ImageFormat.Emf, which works perhaps better.
LVL 39

Expert Comment

ID: 24391001
Not sure whether this is applicable or not, but from tthe EMF specs I get that it still depends (on whether the font supposrts it or not). This is what MS specs says if you use AntiAliased or ClearType:

ANTIALIASED_QUALITY: Specifies that anti-aliasing SHOULD be used when rendering text, if the font supports it.<10>
CLEARTYPE_QUALITY: Specifies that ClearType anti-aliasing SHOULD be used when rendering text, if the font supports it. <11>Fonts that do not support ClearType anti-aliasing include type 1 fonts, PostScript fonts, OpenType fonts without TrueType outlines, rasterized fonts, vector fonts, and device fonts.

Author Comment

ID: 24391119
I'm using the emf format, not the wmf. I'm using Arial, Times Roman, Tahoma fonts which shouldn't have a problem. The crazy thing is, if I fill the background with a white rectangle, it works. If I don't, it doesn't. I guess I just have to have a background for anti-aliasing to work.
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

LVL 39

Expert Comment

ID: 24391219
You are apparently not alone. It seems that some programs don't write the antialiased records, but even if, then there are many programs that do not read that record. You may try EMFExplorer to actually find out whether the records are available and how it looks using GDI or GDI+:

You may also check out this thread, which seems to express the same problem, but unfortunately without a solution:

Author Comment

ID: 24397107
I found that my problem occurred from using TextRendingHint = ClearTypeGridFit. When I set this option to AntiAlias, the text is displayed fine.
LVL 39

Accepted Solution

abel earned 500 total points
ID: 24397363
Ah, good. Interesting, because in your original question you said "Textrenderinghint=antialiasing" and I assumed normal antialiasing. ClearType must be supported by the font, and you use a TrueType font. Hence the situation.

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now