Skip to content

Commit 1707dfc

Browse files
committed
Some minor cleanup from self-review
1 parent 4bef47a commit 1707dfc

File tree

4 files changed

+3
-44
lines changed

4 files changed

+3
-44
lines changed

components/tiny-font

src/UI/BookQuestionsScreen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
#include <cinttypes>
44

55
#include "UI/Bitmaps/DefaultBookQuestions.hpp"
6-
#include "UI/Fonts.hpp"
76
#if CONFIG_USE_BLE_SERVER_PROXY
87
#include "Communications/BLEManager.hpp"
98
#endif
109
#include "Communications/WiFi.hpp"
1110
#include "Misc/StringUtil.hpp"
11+
#include "UI/Fonts.hpp"
1212
#include "sindarin-debug.h"
1313

1414
void BookQuestionsScreen::moveSelection(int delta) {

src/UI/Fonts.cpp

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <Font.hpp>
2-
#include <FontEntry.hpp>
32
#include <array>
43
#include <cinttypes>
54

@@ -13,27 +12,7 @@
1312
#include "IBMFDriver/IBMFFontData.hpp"
1413
#include "IBMFFonts/SolSans_75.h"
1514

16-
// clang-format on
17-
18-
// Here is the list of all fonts that can be selected through a menu in the application.
19-
//
20-
// At boot time, the first entry in the list is loaded by default. If one of the other entries must
21-
// be used to initialixe the font instance defined above, through a call to the font.load() method.
22-
// For example:
23-
//
24-
// result = font.load((fonts_defs::MemoryPtr)fontsList[0].content, fontsList[0].length,
25-
// fontsList[0].kerns, fontsList[0].ligatures);
26-
// if (result) {
27-
// ... was successfull
28-
// } else {
29-
// ... was not successfull
30-
// }
31-
//
32-
// The same approach can be used to change the current font through a selection menu
33-
34-
std::array<FontEntry, 1> fontsList{{{"SolSans", SOLSANS_75_IBMF, SOLSANS_75_IBMF_LEN}}};
35-
36-
FontData mainFont = FontData(fontsList[0].content, fontsList[0].length);
15+
FontData mainFont = FontData(SOLSANS_75_IBMF, SOLSANS_75_IBMF_LEN);
3716

3817
// The following definitions identifie three pre-defined empty font faces that are expected
3918
// to be initialized through a call to font.load() method at application startup. It is expected
@@ -58,23 +37,6 @@ Font fontFace2 = Font(mainFont, 2);
5837
#include "TTFDriver/TTFFont.hpp"
5938
#include "TTFDriver/TTFNotoSansLight.hpp"
6039

61-
// clang-format on
62-
63-
// Here is the list of all fonts that can be selected through a menu in the application.
64-
//
65-
// At boot time, the first entry in the list is loaded by default. If one of the other entries must
66-
// be used to initialixe the font instance defined above, through a call to the font.load() method.
67-
// For example:
68-
//
69-
// result = font.load((ibmf_defs::MemoryPtr)fontsList[0].content, fontsList[0].length,
70-
// fontsList[0].kerns, fontsList[0].ligatures); if (result) {
71-
// ... was successfull
72-
// } else {
73-
// ... was not successfull
74-
// }
75-
//
76-
// The same approach can be used to change the current font through a selection menu
77-
7840
// The following defines the instance of a font that is containing all faces related to that font.
7941
// The parameters are used to initialize the font at boot time to one of the fonts that is part of
8042
// the list above. This is to insure that at any time, the font is loaded with one of the available

src/UI/Fonts.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#pragma once
22

33
#include "Font.hpp"
4-
#include "FontEntry.hpp"
5-
6-
extern std::array<FontEntry, 1> fontsList;
74

85
#if CONFIG_TINYFONT_IBMF
96
#include "IBMFDriver/IBMFFont.hpp"

0 commit comments

Comments
 (0)