TftPrintBdfString()

Library Description ›› Fonts ›› BDF ››
Parent Previous Next

TftPrintBdfString(sString As sTftString, swX_Pos As SWord, swY_Pos As SWord, wEndOfLine As Word, bBreakLine As Byte, wForeColor As Word, wBackColor As Word, pTransparent As Bit)


sString: A null-terminated string to print, up to 72 characters.

swX_Pos: The absolute X position of the character's lower-left corner.

swY_Pos: The absolute Y position of the character's lower-left corner.

wEndOfLine: The absolute X position for the last character in the printed line.

• 0: Max screen width.

• Else: A valid value between swX_Pos and the screen width.

bBreakLine: Defines how long words are broken into new lines:

• 0: Do nothing (no line break).

• 1: Break the line and overflow from swX_Pos.

• 2: Break the line and continue from swX_Pos on a new line (decrement swY_Pos by one).

• 3: Break the line and continue from x = 0.

• 4: Break the line and continue from x = 0 on a new line (decrement swY_Pos by one).

wForeColor: The 16-bit RGB565 color for the character (used for the active pixels of the glyph).

wBackColor: The 16-bit RGB565 color for the background (used for empty pixels in the glyph box).

pTransparent: Whether to use transparency:

• 1: Yes (only active pixels are printed, preserving the background).

• 0: No (inactive pixels are filled with the background color).


Print a string using BDF font.


Example:

TftPrintBdfString("TEST", 1, 1, 310, 0, WHITE, BLACK, 0)


Notes:

• Background color (wBackColor) is ignored if transparency is used, and only the active pixels of the glyph are printed, which is slower than using the background color.

• BDF fonts have uneven sizes and offsets for each glyph, so the exact space needed for a string cannot be predicted. However, string handling with end-of-line management is implemented to prevent overflow.

wEndOfLine specifies the rightmost boundary for the printed string. If set to 0 or greater than the screen width, the string will be printed until the screen's edge.


Include "TftLib\Fonts\SND\F5_BDF_Sail-Regular-25.inc"

'....    

TftSetUp(0)

TftSetBdfFont(5)

TftResetScreen(BLUE)        

TftPrintBdfString("The worst of all deceptions is self-deception.", 40, 220, 280, 0, YELLOW, BLACK, 1)

TftPrintBdfString("The worst of all deceptions is self-deception.", 40, 190, 280, 1, YELLOW, BLACK, 1)

TftPrintBdfString("The worst of all deceptions is self-deception.", 40, 160, 280, 2, YELLOW, BLACK, 1)

TftPrintBdfString("The worst of all deceptions is self-deception.", 40, 100, 280, 3, YELLOW, BLACK, 1)

TftPrintBdfString("The worst of all deceptions is self-deception.", 40, 70, 280, 4, YELLOW, BLACK, 1)






Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through a beautiful website