Variable width fonts are as it says, variable in width. The Letter “i” is smaller that “W”, now you could count up the number of pixels in each character and then add enough spaces at the end to make up the difference. Spaces though are only 2 pixels wide; to make up the 6 normal spaces required would require 18 variable width spaces. It was to solve this problem I wrote “PBT.INC”
The PRINT_BLNK_TO macro enables you to define an end point on the currently printed line and print blank spaces to it.
Syntax: PRINT_BLNK_TO Variable - Variable can be a constant, variable, or expression
Example:
INCLUDE "PROTON_G4.INT" ' board defaults
INCLUDE "PBT.INC" ' THE MACRO
GLCD_EXTERNAL_PRINT=PPRINT ' FORCE PRINTING VAI PPRINT
DIM A AS BYTE
PRINT FONT TIMES_B__9 ' WHAT PRINT TO USE
CLS
A = 100
PRINT INVERSE 1 ' INVERTED PRINTING
PRINT AT 30, 0,"HELLO" '
PRINT_BLNK_TO A + 27 ' PRINT TO THE END OF THE LINE
STOP INCLUDE "TIMES_BOLD_9.FNT"
INCLUDE "PBT.INC" ' THE MACRO
GLCD_EXTERNAL_PRINT=PPRINT ' FORCE PRINTING VAI PPRINT
DIM A AS BYTE
PRINT FONT TIMES_B__9 ' WHAT PRINT TO USE
CLS
A = 100
PRINT INVERSE 1 ' INVERTED PRINTING
PRINT AT 30, 0,"HELLO" '
PRINT_BLNK_TO A + 27 ' PRINT TO THE END OF THE LINE
STOP INCLUDE "TIMES_BOLD_9.FNT"
contributed by Timothy Box.


Menu
Recent Articles


Using PDS with SPI GLCD based on ST7565R Controller
Graphic LCDs based on the ST7565 are cheaper then GLCDs with other controllers. SPI requires only four pins. If the circuit