User manual
527
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
SPI_Glcd_Set_Font
Prototype
procedure SPI_Glcd_Set_Font(activeFont: LongInt; aFontWidth, aFontHeight :
byte; aFontOffs : word);
Description Sets font that will be used with SPI_Glcd_Write_Char and SPI_Glcd_Write_Text routines.
Parameters None.
Returns - activeFont: font to be set. Needs to be formatted as an array of char
- aFontWidth: width of the font characters in dots.
- aFontHeight: height of the font characters in dots.
- aFontOffs: number that represents difference between the mikroPascal PRO for dsPIC30/33 and
PIC24 character set and regular ASCII set (eg. if ‘A’ is 65 in ASCII character, and ‘A’ is 45 in the
mikroPascal PRO for dsPIC30/33 and PIC24 character set, aFontOffs is 20). Demo fonts supplied with
the library have an offset of 32, which means that they start with space.
The user can use fonts given in the le __Lib_GLCDFonts le located in the Uses folder or create
his own fonts.
List of supported fonts:
- Font_Glcd_System3x5
- Font_Glcd_System5x7
- Font_Glcd_5x7
- Font_Glcd_Character8x7
For the sake of the backward compatibility, these fonts are supported also:
- System3x5 (equivalent to Font_Glcd_System3x5)
- FontSystem5x7_v2 (equivalent to Font_Glcd_System5x7)
- font5x7 (equivalent to Font_Glcd_5x7)
- Character8x7 (equivalent to Font_Glcd_Character8x7)
Requires Glcd needs to be initialized for SPI communication, see SPI_Glcd_Init routine.
Example
// Use the custom 5x7 font “myfont” which starts with space (32):
SPI_Glcd_Set_Font(@myfont, 5, 7, 32);
Notes None.