Sunday, December 01, 2002

.NET Font Bug

My colleague Miki Dukic has been doing some font manipulation and was unpleasantly surprised that the GdiCharSet property of the Font class is hard-coded to 1. As always, Anakrino and Reflector proved invaluable while researching this one.

The workaround is to call GetObject on the font handle in order to fill in the LOGFONT structure, then read the lfCharSet byte.

Bug caused by: programmer laziness.

Also GdiCharSet being a byte and not an enum is really lame.

   3:10 PM

Content of this site is © Dejan Jelovic. All rights reserved.