A quick look at Whidbey's TextRenderer

by Michael S. Kaplan, published on 2005/06/27 06:59 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2005/06/27/432986.aspx


Over the weekend, TheMuuj mentioned in a comment:

As far as I know, there are new classes in Whidbey for drawing text with GDI (as a result of GDI+'s questionable screen rendering in some cases). Are these based on DrawText?

This is not exactly the reason. There are two basic problems that come into play with GDI+:

The object is the System.Windows.Forms.TextRenderer class, which has two methods that can be used to render text using GDI/Uniscribe rather than GDI+:

This class and these methods (which have several different overrides) allow WinForms to support new languages as the OS support is added. For example, the ELK support in Windows XP SP2 added font and rendering support to the operating system for Bengali and Malayalam, but versions 1.0 and 1.1 of the .NET Framework would not render these scripts properly, even when the right font was being used. However, version 2.0 (Whidbey) will be able to properly support these scripts whenever the OS can support them....

I have not personally experienced the performance issues but have beentold by people who have that the support can also very useful. I am more of a "language support" guy myself, though. :-)

 

This post brought to you by "" (U+0986, BENGALI LETTER AA)
(A letter that was happy to see proper rendering support of Bengali and Assamese conuncts in managed code using XP SP2 and Whidbey!)


# TheMuuj on 27 Jun 2005 12:41 PM:

So these *are* Uniscribe wrappers? That's good to hear, but it's not readily apparent in the beta-2 documentation. Honestly, it's not immediately apparent in looking at them in Reflector, either.

As a (possibly unintended) bonus, these new methods do seem to solve the pixel-layout problems when displaying and measuring text for screen rendering. While this was not a critical issue, it was a general annoyance to a lot of developers and users.

Part of me feels that it is a shame that these are in System.Windows.Forms and not System.Drawing so that they'd be more available to ASP.NET applications generating graphics on the fly, but I also suspect there's a good reason for this. I suppose I need to research and find out what CAS permissions are required to call these methods.

# Michael S. Kaplan on 27 Jun 2005 12:51 PM:

Well, remember that Uniscribe is plugged in to be able to be used from many of the core GDI functions that eventually get to ExtExtOutW, including DrawText, et. al. The doc issue will hopefully improve. :-) I can't comment on where it is in the object model, though. I am not sure of the exact reasoning....

vchrung on 24 Apr 2009 6:27 AM:

hi,

i have developed a software for one institution here in kerala...So, i have used malayalam font ..i did this in c# in visual studio 2008..and for the malayalam i use the keyman 6.0 and the malayalam font phonetic malayalam.Bt there are some characters in malayalm like “ര്‍,ല്‍“..which gets saved to the access file bt cannot get a report or print fromit...the error says.."unhandled exception" and "a generic error occured in GDI+"...please help...


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2007/11/07 Often 'X doesn't work' in the docs actually implies 'We couldn't get X to work' :-)

2007/08/26 Blame Kannada! (ಕನ್ನಡ)

2007/04/14 Rhymes with Amharic #3 (a.k.a. Read and write a language w/o even getting out of my [em]bed? Kewl!)

2006/06/16 Microsoft *does* support OpenType!

2006/06/12 Uniscribe from Visual Basic

2005/12/19 Customizing shaping behvior in Uniscribe

2005/11/20 Private fonts: for members only

2005/06/27 GDI, GDI+, EUDC, TextRenderer. Connection?

go to newer or older post, or back to index or month or day