FontGetName Method (GdPictureImaging)
In This Topic
Retrieves the name of an available font.
Syntax
'Declaration
Public Function FontGetName( _
ByVal As Integer _
) As String
public string FontGetName(
int
)
public function FontGetName(
: Integer
): String;
public function FontGetName(
: int
) : String;
public: string* FontGetName(
int
)
public:
String^ FontGetName(
int
)
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);
}
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