Converting Font style string into Font

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wizfrog

    Converting Font style string into Font

    Hello,

    I want to convert styles from a String to a Form object.

    So ifound that i can use FontConverter that will do just that... as
    in the help:

    // Create the FontConverter.
    TypeConverter converter =
    TypeDescriptor. GetConverter(ty peof(Font));
    Font font = (Font) converter.Conve rtFromString("A rial, 12pt");

    except that it only seems ot take FontFamily and FontSize, but won't
    understand FontStyle (Bold, Italic etc...)

    Does anyone know of a converter that does it all?

    Thanks for help!
  • Wizfrog

    #2
    Re: Converting Font style string into Font

    I guess I had my string syntax wrong...

    it has to be

    FontFamily, FontSize[Units],[style=style1[,...


    It works fine now.

    Comment

    Working...