tags:

views:

21

answers:

1

We can enumerate over the fonts available on system using Fonts.SystemFontFamilies.

  1. How can I distinguish between composite fonts and plain-font?
  2. How can I get the FontFamilies used in a composite font?

I tried FontFamily.FamilyTypefaces, but it wasn't helpful.

Thanks

+1  A: 

Try checking FontFamily.FamilyMaps, which should always be empty for physical fonts and non-empty for composite fonts.

var font1 = new FontFamily("Global User Interface");
var isComposite1 = font1.FamilyMaps.Any(); // True
var font2 = new FontFamily("Arial");
var isComposite2 = font2.FamilyMaps.Any(); // False
Quartermeister
I had tried that earlier. I always get false.
Nitesh Chordiya
@Nitesh: Ah, it works in .NET 4.0 but not in .NET 3.5.
Quartermeister
Thanks Quartermeister, Its fine for me to move to .NET 4.0.
Nitesh Chordiya