TftPrintSndChar()

Library Description ›› Fonts ›› SND ››
Parent Previous Next

TftPrintSndChar(bChar As Byte, bFontSize As Byte, wX_Pos As Word, wY_Pos As Word, pPosition As Bit, wForeColor As Word, wBackColor As Word, pTransparent As Bit)


bChar = character to print

bFontSize = font size

• 0 or 1 = nominal size

• 2, 3, 4, ... = multiples of the nominal size

wX_Pos = x position for the lower left corner of the character

wY_Pos = y position for the lower left corner of the character

pPosition = position type for the lower left corner of the character

• 0 = absolute, actual pixel position on the TFT screen (e.g., wX_Pos = 152, wY_Pos = 86)

• 1 = relative, based on the virtual division of the TFT screen into columns and rows, divided by FontPixels and FontSpace (e.g., wX_Pos = 5, wY_Pos = 2, with FontPixels = 8 and FontSpace = 9, means actual position x = 5 * 8 = 40; y = 2 * 9 = 18)

wForeColor = character color in 16-bit RGB565 format - this color will be used to set pixels for the glyph

wBackColor = background color in 16-bit RGB565 format - empty pixels in the glyph’s bounding box will use this color

pTransparent = transparency option

• 1 = Yes (use transparency)

• 0 = No (use background color)


Print character using SND font.


Example:

TftPrintSndChar("G", 2, 1, 1, 0, WHITE, BLACK, 0)


Note: If transparency is enabled, the background color (wBackColor) will be ignored, and only the pixels of the glyph will be printed. However, this is slower than using a background color.


$define FontSmooth          1

$define FontMaxSpace        16

$define FontMaxPixels       16

Include "TftLib\Fonts\SND\F2_SND_16x16_Basic.inc"

'....

TftSetUp(0)

TftSetSndFont(2,0)

TftResetScreen(BLUE)

TftPrintSndChar("G", 1, 10, 10, 0, WHITE, BLACK, 0)

TftPrintSndChar("G", 1, 40, 10, 0, WHITE, BLACK, 1)

TftPrintSndChar("G", 1, 1, 1, 1, WHITE, BLACK, 0)

TftPrintSndChar("G", 1, 3, 1, 1, WHITE, BLACK, 1)

TftPrintSndChar("G", 2, 1, 2, 1, WHITE, BLACK, 0)

TftPrintSndChar("G", 2, 3, 2, 1, WHITE, BLACK, 1)

TftSetSndFont(2,1)

TftPrintSndChar("G", 2, 5, 2, 1, WHITE, BLACK, 0)

TftPrintSndChar("G", 2, 8, 2, 1, WHITE, BLACK, 1)

TftSetSndFont(2,0)

TftPrintSndChar("G", 3, 0, 3, 1, WHITE, BLACK, 0)

TftPrintSndChar("G", 3, 1, 3, 1, WHITE, BLACK, 1)

TftSetSndFont(2,1)

TftPrintSndChar("G", 3, 2, 3, 1, WHITE, BLACK, 0)

TftPrintSndChar("G", 3, 3, 3, 1, WHITE, BLACK, 1)






Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc