Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RadarDemo 3DDemo RadarDemoT
GrFont.cpp
- Committer:
- karpent
- Date:
- 2016-11-10
- Revision:
- 2:02b7b78e8510
File content as of revision 2:02b7b78e8510:
//
// GrFont.cpp - System font wrapper class
//
#include "GrFont.h"
#include "stm32746g_discovery_lcd.h"
/*******************************************************************************
* Definition of fonts provided by stm32746g_discovery_lcd driver
******************************************************************************/
const sFONT * GrFont::_fontType[FontsNumber] = { &Font8, &Font12, &Font16, &Font20, &Font24 };
GrFont::GrFont()
{
SetFontType(Courier12);
}
GrFont::GrFont(GrFontType fontType)
{
SetFontType(fontType);
}
uint16_t GrFont::Width()
{
return _fontType[_fontTypeSelected]->Width;
}
uint16_t GrFont::Height()
{
return _fontType[_fontTypeSelected] -> Height;
}
void GrFont::SetFontType(GrFontType fontType)
{
if(fontType < FontsNumber) {
_fontTypeSelected = fontType;
}
}
sFONT *GrFont::GetSystemFont()
{
return (sFONT *)_fontType[_fontTypeSelected];
}