c# - How to check if a font supports a specific style -


I am getting the following exception while changing my application font, because I use a strike in one part of my application And some fonts do not support it:

Enter image details here < / P>

I change my application font using a font dialog I need to check that the selected font supports Strikeout style after specifying it in my application.

What is the recommended way to do this? I know that I can make a font with style and catch the exception, but is there another great way to do this?

Thanks in advance.


Edit : User selects a font, not the initial Strikeout. At that moment I need to check that the font style supports Strikeout because I am making a strikage font in one part of my application. If the Font does not support the Strikeout style then the user will not be allowed to choose the font.

Updated: (To display updates in the initial post ):

  InstalledFontCollection ifc = New InstalledFontCollection (); (Int i = 0; i & lt; ifc.Families.Length; i ++) {if (ifc.Families [i] .SETLAPBable (Fonts Style. Strikeout)) {// "Font Selector For Your Family" "Add specific fonts with}}    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -