Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

FontFamily.IsAvailable method

Applies to: desktop apps only

The FontFamily::IsAvailable method determines whether this FontFamily object was created successfully.

Syntax

BOOL IsAvailable() const;

Parameters

This method has no parameters.

Return value

Type:

Type: BOOL

If this FontFamily object was created successfully, this method returns TRUE; otherwise, it returns FALSE.

Examples

The following example creates a FontFamily object. If the FontFamily object is created successfully, the example draws text.


VOID Example_IsAvailable(HDC hdc)
{
   Graphics graphics(hdc);

   // Create a FontFamily object.
   FontFamily myFontFamily(L"arial");
   
   // Check to see if myFontFamily is available.
   BOOL isAvailable = myFontFamily.IsAvailable();

   // If myFontFamily is available, draw text.
   if (isAvailable)
   {
       SolidBrush solidbrush(Color(255, 0, 0, 0));
       Font       font(&myFontFamily, 16);
       WCHAR      string[100];
       swprintf_s(string, L"myFontFamily is available");
       graphics.DrawString(string,
                           wcslen(string), &font, PointF(0, 0), &solidbrush);
   }
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusheaders.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

FontFamily
FontFamily::GetLastStatus
Constructing Font Families and Fonts

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.