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
Diff: GrFont.cpp
- Revision:
- 2:02b7b78e8510
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/GrFont.cpp Thu Nov 10 15:34:43 2016 +0000
@@ -0,0 +1,50 @@
+//
+// 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];
+}
+
+
+