5

I'm trying to draw text over a bitmap image and I've done some research and found that .NET/GDI+ doesn't support OTF fonts. I read somewhere that you could use TextRenderer.DrawText to render OTF fonts with GDI, but I can't seem to figure out how, nor does the quality compare to Graphics.DrawString in the least bit.

  1. First of all, is it possible to use OTF fonts at all in VS or did I read something incorrectly?

  2. Second, If the answer is TextRenderer.DrawText, how do I use the OTF fonts? It looks like I have to use the System.Drawing.Font class, but I don't think those support the fonts and that's the issue, correct?

  3. How do I get the fonts to render clearly like the TTF fonts using GDI+ (Graphics.DrawString)

  4. Using Graphics.DrawString I was able to use a RectangleF (with specified width, 0 height) as a boundary for my text, and the text wrapped correctly. With TextRenderer.DrawText, the ability to use RectangleF disappears and only allows Rectangle which doesn't seem to allow 0 height, while still allowing text to display (ie. text must be within the rectangle, and text wrapping does not work). Am I doing it wrong?

Any help would be greatly appreciated. If this cannot be done, is there a way to convert the OTF fonts, or find the Gotham font family online in TTF version? I really need these fonts!

Evan Layman
  • 3,691
  • 9
  • 31
  • 48
  • 1
    I ended up using VMware Player to run Ubuntu so I could use [FontForge](http://fontforge.sourceforge.net/) to convert all of my OTF fonts to TTF. Hope this helps anyone with the same problem. Too bad VS isn't compatible with OTF – Evan Layman Jul 29 '11 at 22:41

0 Answers0