TftPrintBdfText()

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

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)


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.

• 1 to 60: Turn the page with a delay of bPrintMode seconds.

• 61 to 100: Print a page typewriter style, then stop. In typewriter style, characters are printed with a delay of 5 * (bPrintMode - 60) ms between them.

• 101 to 160: Print a page typewriter style, then turn the page with a delay of bPrintMode * 0.5 seconds. Typewriter style is used, with a delay of 5 * (bPrintMode - 100) ms between characters.


Print 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:

• 0: Text is displayed immediately on the entire page formed by swX_Pos, swY_Pos, wEndOfLine, and wEndOfPage. If the text exceeds the available space, printing stops and the procedure exits.

• 1 to 60: Text is displayed immediately on the entire page. If the text exceeds the page, printing pauses for bPrintMode seconds (1 to 60). The display is filled with the background color (wBackColor) to erase the text, and then printing continues. This repeats until all text is printed.

• 61 to 100: Text is displayed slowly on the entire page, with a delay of 5 * (bPrintMode - 60) ms between each character (typewriter style). If the text exceeds the page, printing stops and the procedure exits.

• 101 to 160: Text is displayed slowly with a delay of 5 * (bPrintMode - 100) ms between each character. If the text exceeds the page, printing pauses for 20 * (bPrintMode - 100) ms, the display is cleared with the background color (wBackColor), and printing continues. This repeats until all text 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:

• 1: A simplified word processing method is used. If a word needs to be carried over to the next line, it will either be completely displayed on the current line or moved entirely to the next line. For example, "in" or "cat" will be displayed in full or moved. "Home" will either be fully displayed, broken into "ho me", or moved entirely to the next line.

• 0: When the current line reaches the end of the screen, the word will break and continue on the next line, which may leave or carry over a single character.

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)

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)

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)

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)

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)

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)

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: Make Your PDFs More Secure with Encryption and Password Protection