OkfGetFontChar
(macro definition)

Get the OKFCHAR pointer of a given font character.

OKFCHAR *OkfGetFontChar( OKFFONT *pFont, unsigned char ch );

Routine Required Header
OkfGetFontChar "okf.h"
 

Libraries

OKLIB.A Oankali's GP32 run-time library
 

Return Value

OkfGetFontChar returns a pointer that points to the extended information of a character in the font character set.


Parameters

pFont

A pointer to an OKFFONT structure.


Remarks

The OkfGetFontChar macro definition is used to retrieve the extended information of a given character through its OKFCHAR structure. The character ch must exist in the character set of the font pointed by pFont, else an unpredictable pointer is returned.


Example

// Get the width of a char of the current font
int GetCharWidth(unsigned char ch)
{
  OKFFONT *pFont;
  OKFCHAR *pChar;

  // Get current font
  pFont = OkfGetCurrentFont();
  if (pFont == NULL)
    return 0;
  
  // Get char extended information
  pChar = OkfGetFontChar(pFont, ch);

  // Return width
  return pChar->width;
}


See Also

OKF Font Engine Routines, OKF Font Engine Structures, OKFFONT, OKFCHAR