![]() |
![]() |
![]() |
![]() |
Font.h and FontSelect.h. For more information on fonts, see the "Text" section in the Palm OS Programmer's Companion.
Int16 FntAverageCharWidth (void)
Int16 FntBaseLine (void)
Int16 FntCharHeight (void)
void FntCharsInWidth (Char const * string, Int16 *stringWidthP, Int16 *stringLengthP, Boolean *fitWithinWidth)
|   |
|
Pointer to the character string. |
|   |
|
Maximum width to allow (in pixels). |
|   |
|
Maximum length of text to allow, in bytes (assumes current font). |
|   |
|
Set to true if string is considered truncated. |
|   |
|
Set to the width of the characters allowed. |
|   |
|
Set to the length in bytes of the text that can appear within the width. |
|   |
|
true if the string is considered truncated, false if it isn't. |
Int16 FntCharsWidth (Char const *chars, Int16 len)
Int16 FntCharWidth (Char ch)
FntCharWidth works with single-byte characters only. To determine the pixel width of a single-byte character or a multi-byte character, use TxtCharWidth instead of this function on systems that support the Text Manager.
Err FntDefineFont (FontID font, FontPtr fontP)
|   |
|
Pointer to the custom font resource to be used by this function. This resource must remain locked until the calling application undefines the custom font or quits. |
FontSelect, FntSetFont
Int16 FntDescenderHeight (void)
FontID FntGetFont (void)
FontPtr FntGetFontPtr (void)
FontPtr of the current font.
void FntGetScrollValues (Char const *chars, UInt16 width, UInt16 scrollPos, UInt16 *linesP, UInt16 *topLine)
|   |
|
Null-terminated string. |
|   |
|
Width to word wrap at, in pixels. |
|   |
|
Character position of the first visible character. |
|   |
|
(returned) number of lines of text. |
|   |
|
(returned) top visible line. |
linesP and the top visible line in topLine.
Int16 FntLineHeight (void)
Int16 FntLineWidth (Char const *pChars, UInt16 length)
|   |
|
Pointer to a string of characters. |
|   |
|
Length in bytes of the string. |
FontID FntSetFont (FontID font)
Int16 FntWidthToOffset (Char const *pChars, UInt16 length, Int16 pixelWidth, Boolean *leadingEdge, Int16 *truncWidth)
|   |
|
Pointer to the character string. Must not be NULL. |
|   |
|
Length in bytes of pChars. |
|   |
|
A horizontal location on the screen, given in pixels. |
|   |
|
Set to true if the pixel position pixelWidth falls on the left side of the character. Pass NULL for this parameter if you don't need this information. |
|   |
|
The width of the text (in pixels) up to the returned offset. Pass NULL for this parameter if you don't need this information. |
pChars of the character displayed at the location pixelWidth.
UInt16 FntWordWrap (Char const *chars, UInt16 maxWidth)
|   |
|
Pointer to a null-terminated string. |
|   |
|
Maximum line width in pixels. |
void FntWordWrapReverseNLines (Char const *const chars, UInt16 maxWidth, UInt16 *linesToScrollP, UInt16 *scrollPosP)
|   |
|
Pointer to a null-terminated string. |
|   |
|
Maximum line width in pixels. |
|   |
|
The number of lines to scroll. Upon return, contains the number lines that were scrolled. |
|   |
|
Byte offset of the first character. Upon return, contains the first character after wrapping. |
scrollPosP and linesToScrollP.
FontID FontSelect (FontID fontID)
|   |
|
A fontID value specifying the font to be highlighted as the default choice in the dialog box this function displays. This value must be one of the following system-supplied constants: |
|   |
|
Standard plain text font |
|   |
|
Bold version of stdFont |
|   |
|
Larger version of boldFont |
fontID value representing the font that the user chose in the dialog box this function displays.
sysFtrDefaultFont and sysFtrDefaultBoldFont to determine the default font for the application. For example:
FtrGet(sysFtrCreator, sysFtrDefaultFont,
&fntID)fntID contains an ID compatible with the FontSelect function.
FntGetFont, FntSetFont
|   | ![]() |
![]() |
![]() |
![]() |
  |