TftPrintBdfText()

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

Syntax

TftPrintBdfText(ByRef dwFlashAddress As Dword, swX_Pos As SWord, swY_Pos As SWord, wEndOfLine As Word, wEndOfPage As Word, pBreakLine As Byte, wForeColor As Word, wBackColor As Word, pTransparent As Bit, bPrintMode As Byte)

Parameters

Parameter

Description

dwFlashAddress

The address in flash memory to start reading from.

swX_Pos

The absolute X-position for the upper-left corner of the virtual print box.

swY_Pos

The absolute Y-position for the upper-left corner of the virtual print box.

wEndOfLine

The absolute X-position for the lower-right corner of the virtual print box.

wEndOfPage

The absolute Y-position for the lower-right corner of the virtual print box.

pBreakLine

Defines how to break long words into new lines. The last character of the current line will not be split.
0: Break the line if there is not enough space for the next character. New lines will be trimmed by 1 character, potentially leaving or translating 1 character at the end of the line.
1: Look ahead; if a word would result in only one character left at the end of the line, break the word or move it to the next line.

wForeColor

The 16-bit RGB565 color for the character's active pixels (used to form the glyph).

wBackColor

The 16-bit RGB565 color for the background (used for empty pixels forming the character box).

pTransparent

Use transparency:
1: Yes (only the active pixels of the glyph are printed).
0: No (inactive pixels are filled with the background color).

bPrintMode

Determines how the text is displayed when it doesn't fit on the screen.
0: Print a page, then stop.

Overview

Draws a text from a Flash table with BDF font in virtual rectangle box top to bottom. 

Example

TftPrintBdfText(myText, 20, 220, 300, 20, 1, RED, BLACK, 1, 104)

'...

Dim myText As Flash8 = "One thing I know is that I know nothing. This is the source of my wisdom. - Socrates", 0

The background color (wBackColor) will be ignored if transparency is used. Only the glyph's pixels will be printed, which is slower than using the background color.


bPrintMode controls how the text from the flash table is printed:

For different delay coefficients for options 61 to 100 and 101 to 160, open BDF.inc in the folder TftLib\Fonts\BDF.

Look for the procedure TftPrintDelay(bPrintMode As Byte) at the bottom, where you can adjust the delay in milliseconds.

pBreakLine determines how words are broken across lines:

In both cases, the last character of the current line will not be split. It will either be fully displayed or carried over to the next line.


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

'....    

TftSetUp(0, 0)

TftSetBdfFont(5)

TftResetScreen(BLUE)

TftRectangleSNTC(20,220, 300,20, BLACK)      

TftPrintBdfText(myText, 20, 190, 300, 20, 0, YELLOW, BLACK, 1, 0)

Dim myText As Flash8 = "The positron or antielectron is the particle ",_

"with an electric charge of +1e, a spin of 1/2 (the same as the electron), ",_

"and the same mass as an electron. It is the antiparticle (antimatter ",_

"counterpart) of the electron. When a positron collides with an electron, ",_

"annihilation occurs. If this collision occurs at low energies, it results ",_

"in the production of two or more photons.", 0 

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

'....    

TftSetUp(0, 0)

TftSetBdfFont(5)

TftResetScreen(BLUE)

TftRectangleSNTC(20,220, 300,20, BLACK)      

TftPrintBdfText(myText, 20, 190, 300, 20, 1, YELLOW, BLACK, 1, 0)

Dim myText As Flash8 = "The positron or antielectron is the particle ",_

"with an electric charge of +1e, a spin of 1/2 (the same as the electron), ",_

"and the same mass as an electron. It is the antiparticle (antimatter ",_

"counterpart) of the electron. When a positron collides with an electron, ",_

"annihilation occurs. If this collision occurs at low energies, it results ",_

"in the production of two or more photons.", 0 

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

'....    

TftSetUp(0, 0)

TftSetBdfFont(5)

TftResetScreen(BLUE)

TftRectangleSNTC(20,220, 300,20, BLACK)      

TftPrintBdfText(myText, 20, 190, 300, 20, 1, YELLOW, BLACK, 1, 5)

Dim myText As Flash8 = "The positron or antielectron is the particle ",_

"with an electric charge of +1e, a spin of 1/2 (the same as the electron), ",_

"and the same mass as an electron. It is the antiparticle (antimatter ",_

"counterpart) of the electron. When a positron collides with an electron, ",_

"annihilation occurs. If this collision occurs at low energies, it results ",_

"in the production of two or more photons.", 0 

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

'....    

TftSetUp(0, 0)

TftSetBdfFont(5)

TftResetScreen(BLUE)

TftRectangleSNTC(20,220, 300,20, BLACK)      

TftPrintBdfText(myText, 20, 190, 300, 20, 0, YELLOW, BLACK, 1, 80)

Dim myText As Flash8 = "The positron or antielectron is the particle ",_

"with an electric charge of +1e, a spin of 1/2 (the same as the electron), ",_

"and the same mass as an electron. It is the antiparticle (antimatter ",_

"counterpart) of the electron. When a positron collides with an electron, ",_

"annihilation occurs. If this collision occurs at low energies, it results ",_

"in the production of two or more photons.", 0 

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

'....    

TftSetUp(0, 0)

TftSetBdfFont(5)

TftResetScreen(BLUE)

TftRectangleSNTC(20,220, 300,20, BLACK)      

TftPrintBdfText(myText, 20, 190, 300, 20, 1, YELLOW, BLACK, 1, 80)

Dim myText As Flash8 = "The positron or antielectron is the particle ",_

"with an electric charge of +1e, a spin of 1/2 (the same as the electron), ",_

"and the same mass as an electron. It is the antiparticle (antimatter ",_

"counterpart) of the electron. When a positron collides with an electron, ",_

"annihilation occurs. If this collision occurs at low energies, it results ",_

"in the production of two or more photons.", 0 

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

'....    

TftSetUp(0, 0)

TftSetBdfFont(5)

TftResetScreen(BLUE)

TftRectangleSNTC(20,220, 300,20, BLACK)      

TftPrintBdfText(myText, 20, 190, 300, 20, 1, YELLOW, BLACK, 1, 112)

Dim myText As Flash8 = "The positron or antielectron is the particle ",_

"with an electric charge of +1e, a spin of 1/2 (the same as the electron), ",_

"and the same mass as an electron. It is the antiparticle (antimatter ",_

"counterpart) of the electron. When a positron collides with an electron, ",_

"annihilation occurs. If this collision occurs at low energies, it results ",_

"in the production of two or more photons.", 0 

Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help File Creation Features