GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / FontGetCount Method
Example





In This Topic
FontGetCount Method (GdPictureImaging)
In This Topic
Retrieves the number of fonts available.
Syntax
'Declaration
 
Public Function FontGetCount() As Integer
public int FontGetCount()
public function FontGetCount(): Integer; 
public function FontGetCount() : int;
public: int FontGetCount(); 
public:
int FontGetCount(); 

Return Value

The number of fonts available.
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