Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / FontGetName Method
Value between 1 and FontGetCount().
Example





In This Topic
    FontGetName Method (GdPictureImaging)
    In This Topic
    Retrieves the name of an available font.
    Syntax
    'Declaration
     
    
    Public Function FontGetName( _
       ByVal FontNo As Integer _
    ) As String
    public string FontGetName( 
       int FontNo
    )
    public function FontGetName( 
        FontNo: Integer
    ): String; 
    public function FontGetName( 
       FontNo : int
    ) : String;
    public: string* FontGetName( 
       int FontNo
    ) 
    public:
    String^ FontGetName( 
       int FontNo
    ) 

    Parameters

    FontNo
    Value between 1 and FontGetCount().

    Return Value

    A font name.
    Example
    Getting the number of available fonts and finding out the name of the first one if any exists.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        int fontCount = gdpictureImaging.FontGetCount();
        if (fontCount > 0)
        {
            string fontName = gdpictureImaging.FontGetName(1);
            MessageBox.Show("The number of available fonts: " + fontCount.ToString() +
                            "\nThe name of the first font: " + fontName, "Fonts", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        else
            MessageBox.Show("No fonts are available", "Fonts", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    See Also