Results 1 to 12 of 12

Thread: How to Get Font Name and it's Own Styles.?

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: How to Get Font Name and it's Own Styles.?

    Quote Originally Posted by jmcilhinney View Post
    There's no property or method that will give you the list you want. What you have to do is, once you've got a Font, get its FontFamily first and then call IsStyleAvailable on that for each FontStyle value. Note that you're going to have to call it for composite values as well as discrete, e.g
    vb.net Code:
    1. Dim availableStyles As List(Of FontStyle)
    2.  
    3. If myFontFamily.IsStyleAvailable(FontStyle.Bold) Then
    4.     availableStyles.Add(FontStyle.Bold)
    5. End If
    6.  
    7. If myFontFamily.IsStyleAvailable(FontStyle.Italic) Then
    8.     availableStyles.Add(FontStyle.Italic)
    9. End If
    10.  
    11. If myFontFamily.IsStyleAvailable(FontStyle.Bold Or FontStyle.Italic) Then
    12.     availableStyles.Add(FontStyle.Bold Or FontStyle.Italic)
    13. End If
    You can make it nicer than that but you get the idea.
    Yes..!..Yes..! this is i am expecting one .......
    but different fonts has different Styles Name ...
    how can i find that Mr.jmcilhinney

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: How to Get Font Name and it's Own Styles.?

    Quote Originally Posted by medsont View Post
    Yes..!..Yes..! this is i am expecting one .......
    but different fonts has different Styles Name ...
    how can i find that Mr.jmcilhinney
    I just told you how.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width