OkfGetFont
(macro definition)

Get the OKFFONT pointer of a given registered font.

OKFFONT *OkfGetFont( int handle );

Routine Required Header
OkfGetFont "okf.h", "list.h"
 

Libraries

OKLIB.A Oankali's GP32 run-time library
 

Return Value

In case of success OkfGetFont returns a pointer that points to the registered font of the given handle, otherwise it returns NULL.


Parameters

handle

The handle of a valid registered font.


Remarks

The OkfGetFont macro definition is used to retrieve the pointer that points to the OKFFONT structure of a font given its handle. If handle does not pertain to a valid registered font, NULL is returned.

This macro definition can be time consuming, so if it has to be included in a loop, it's preferable to stock the returned pointer in a temporal variable, than use this variable instead.


Example

// Get default height of a given font
int GetDefaultHeight(int handle)
{
  OKFFONT *pFont;

  // Get font
  pFont = OkfGetFont(handle);
  
  // Return default height
  if (pFont != NULL)
    return pFont->pOkf->defaultHeight;
  else
    return 0;
}


See Also

OKF Font Engine Routines, OKF Font Engine Structures, OkfGetCurrentFont, OkfGetHandle, OKFFONT