1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
30
33
36
39
42
45
48
51
54
57
59
60
#include <fonts/ApplicationFontProvider.hpp>
#include <touchgfx/InternalFlashFont.hpp>
#ifndef NO_USING_NAMESPACE_TOUCHGFX
using namespace touchgfx;
#endif
extern touchgfx::InternalFlashFont& getFont_Asap_Regular_36_4bpp();
extern touchgfx::InternalFlashFont& getFont_Asap_Regular_20_4bpp();
extern touchgfx::InternalFlashFont& getFont_Asap_Regular_22_4bpp();
extern touchgfx::InternalFlashFont& getFont_Asap_Regular_22_4bpp();
extern touchgfx::InternalFlashFont& getFont_SourceSansPro_Regular_100_4bpp();
extern touchgfx::InternalFlashFont& getFont_SourceSansPro_Regular_18_4bpp();
extern touchgfx::InternalFlashFont& getFont_SourceSansPro_Regular_14_4bpp();
extern touchgfx::InternalFlashFont& getFont_SourceSansPro_Regular_64_4bpp();
extern touchgfx::InternalFlashFont& getFont_Asap_Regular_12_4bpp();
extern touchgfx::InternalFlashFont& getFont_RobotoCondensed_Regular_12_4bpp();
touchgfx::Font* ApplicationFontProvider::getFont(touchgfx::FontId fontId)
{
switch(fontId)
{
case Typography::TEMPERATURE_DEGREE:
return &(getFont_Asap_Regular_36_4bpp());
case Typography::TEMPERATURE_DEGREE:
case Typography::TEMPERATURE_MENU:
return &(getFont_Asap_Regular_20_4bpp());
case Typography::TEMPERATURE_MENU:
case Typography::TEMPERATURE_MENU_DEGREES:
return &(getFont_Asap_Regular_22_4bpp());
case Typography::TEMPERATURE_MENU_DEGREES:
case Typography::TEMPERATURE_HEADLINE:
return &(getFont_Asap_Regular_22_4bpp());
case Typography::TEMPERATURE_HEADLINE:
case Typography::WEATHER_LARGE_TEXT:
return &(getFont_SourceSansPro_Regular_100_4bpp());
case Typography::WEATHER_LARGE_TEXT:
case Typography::WEATHER_NORMAL_TEXT:
return &(getFont_SourceSansPro_Regular_18_4bpp());
case Typography::WEATHER_NORMAL_TEXT:
case Typography::WEATHER_SMALL_TEXT:
return &(getFont_SourceSansPro_Regular_14_4bpp());
case Typography::WEATHER_SMALL_TEXT:
case Typography::WEATHER_TILE_TEXT:
return &(getFont_SourceSansPro_Regular_64_4bpp());
case Typography::WEATHER_TILE_TEXT:
case Typography::TILE_ID:
return &(getFont_Asap_Regular_12_4bpp());
case Typography::TILE_ID:
case Typography::MCULOAD_TEXT:
return &(getFont_RobotoCondensed_Regular_12_4bpp());
case Typography::MCULOAD_TEXT:
default:
return 0;default
}switch (fontId) { ... }
}{ ... }