OkfSplitLines

Split a text in multiple lines given a width and taking into account the properties in okf.

int OkfSplitLines( unsigned char *pStr, int width, unsigned char *pResultStr );

Routine Required Header
OkfSplitLines "okf.h"
 

Libraries

OKLIB.A Oankali's GP32 run-time library
 

Return Value

In case of success OkfSplitLines returns 0, otherwise it returns -1. Look at okf.lastError for details on what happened.


Parameters

pStr

A pointer to the string to be divided.

width

The maximum width in pixels that can have a line in the text.

pResultStr

A pointer to the allocated buffer where to put the result of the splitting.


Remarks

The OkfSplitLines function splits a string to a given width taking into account the properties settled in okf (font, character and line separation). When splitting the string, the function tries to keep complete words whenever is possible.

This function is very useful when a message box has to be displayed in a window on the screen. And when OkfSplitLines is used in conjunction with the clipping functionalities of the OKF Font Engine, a scrollable message box can be done very easily.


Example

See OkfSetToDefaults example.


See Also

OKF Font Engine Routines, OKF Font Engine Constants