Mitchboo

When I use

fontDialog1.ShowDialog()

to display a list of all fonts in my system, I get only the TTF fonts listed. None of the OpenType *.otc fonts appear. Do I miss some filter parameter, or there something else I should do

Hope it's not a bug :^<

Any help greatly appreciated.

Mitch




Re: Windows Forms General fontDialog1.ShowDialog() does not show *.OTC fonts

Peter Ritchie

You're in luck: it's not a bug. GDI+ when .NET 2.0 was released did not support OpenType fonts. GDI+ is used for most WinForms things so, even if you could show OpenType fonts in the FontDialog; you wouldn't be able to use them anywhere.




Re: Windows Forms General fontDialog1.ShowDialog() does not show *.OTC fonts

nobugz

Editorial: and let hope it stays that way. Having to use Acrobat Reader is punishment enough.





Re: Windows Forms General fontDialog1.ShowDialog() does not show *.OTC fonts

Peter Ritchie

nobugz wrote:
Editorial: and let hope it stays that way. Having to use Acrobat Reader is punishment enough.
You don't Flash or Dreamweaver

It doesn't look that way. http://blogs.msdn.com/michkap/archive/2006/06/16/634291.aspx

I don't know if GDI+ in Vista supports OpenType; if not, it's going to be a long time before OpenType will be supported in .NET.






Re: Windows Forms General fontDialog1.ShowDialog() does not show *.OTC fonts

Mitchboo

Sharing knowledge is the most generous thing one can do.

Thank you Peter so much for that precise and reasssuring answer. I'll go around this limitation, then.






Re: Windows Forms General fontDialog1.ShowDialog() does not show *.OTC fonts

Mitchboo

I am not myself using Acrobat or things like Distiller, but my customers do : I design fonts.

Unfortuantely, neither WordPad or WWord 2007 can support WPF and I had to dig into it to offer a little better than Notepad. The other alternative being the excellent, but not terribly cheap InDesign from Adobe.

Well. Forefrtont architecture is nice, at any cost.






Re: Windows Forms General fontDialog1.ShowDialog() does not show *.OTC fonts

MattLindley

Not sure if this will help anyone or not...

I wanted to write my own font viewer (Visual Studio 2005), and ran into the same problem. The InstalledFontsCollection shows only TT fonts. OpenType and Adobe fonts are left out. So, I came up with two work arounds - 1 for discovering the names of all the fonts in the system and 1 for displaying samples of every font.

To discover the fonts installed on the computer, I integrated a small Flash app that searches for fonts - yep, Flash can see them all. It then passes that list of fonts back to my main application (VB.NET, by the way).

Then, to display the fonts, I incorporated a browser object into my form. Apparently, even though there is not a way to get the *complete* list of fonts using a built in function, the built in browser controls are perfectly capable of displaying any fonts (TrueType, OpenType and Adobe, inclusive).

Unfortunately, these fixes are very messy and introduce a whole other mess of problems.