Syntax
void GetFontSize(
unsigned int *height,
unsigned int *width
);
Parameters
- height
-
[out] The height of the characters in the current font, measured in pixels.
- width
-
[out] The width of the characters in the current font, measured in pixels.
Return value
None
Remarks
Gets the vertical and horizontal dimensions of the font you are using.
Each font size is as follows.
Each font size is as follows.
Font | width × height |
---|---|
FONT_TINY | 6 × 6 |
FONT_SMALL | 8 × 8 |
FONT_MEDIUM | 6 × 12 |
FONT_LARGE FONT_LARGE2 |
8 × 16 |
FONT_HUGE | 12 × 24 |
Requirements
Header file:
lib.hLibrary file:
libSTARTUPOPH5000.a
Sample
#include <stdio.h>
#include "lib.h"
void main(void)
{
unsigned int height, width, font=0;
printf("[GetFontSize]\n");
printf("Please any key\r");
ResetKey();
while(!kbhit())
Idle();
if(((++font)%2)==0)
{
SetFont(LARGE_FONT,NULL);
}
else
{
SetFont(SMALL_FONT,NULL);
}
GetFontSize(&height, &width);
printf("\f%d chars/line\n%dlines", DISP_WIDTH/width, DISP_HEIGHT/height);
ResetKey();
while(!kbhit())
{
Idle();
}
SetFont(TINY_FONT,NULL);
}
Last updated: 2021/09/26