OkfGetCurrentFont
(macro definition)

Get the OKFFONT pointer of the current font.

OKFFONT *OkfGetCurrentFont( void );

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

Libraries

OKLIB.A Oankali's GP32 run-time library
 

Return Value

In case of success OkfGetCurrentFont returns a pointer that points to the current font OKFFONT structure, otherwise it returns NULL.


Parameters

None.


Remarks

The OkfGetCurrentFont macro definition is used to retrieve the pointer that points to the OKFFONT structure of the current font. If there is no current font, or the current font is invalid, 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 current font
int GetCurrentDefaultHeight(void)
{
  OKFFONT *pFont;

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


See Also

OKF Font Engine Routines, OKF Font Engine Structures, OkfGetFont, OKFFONT