Add framebuffer release and font metadata access

Introduce methods to temporarily release the 48KB framebuffer during memory-intensive chapter builds, allowing the memory to be reused. Add font metadata query methods (hasGlyphMeta, ensureAdvance) that check glyph existence and fetch advance metrics without loading full bitmap data, avoiding expensive SD reads during layout measurement.
This commit is contained in:
Justin Mitchell
2026-07-08 04:46:25 -04:00
parent e027f60bf0
commit bfb8aacdae
19 changed files with 447 additions and 119 deletions
+1
View File
@@ -12,6 +12,7 @@ if(NOT EXISTS "${FREEINK_BOOK_INCLUDE}")
else()
add_executable(CpFontAdapterTest
CpFontAdapterTest.cpp
SdCardFontStubs.cpp
${REPO_ROOT}/src/activities/reader/CpFontAdapter.cpp
${REPO_ROOT}/lib/EpdFont/EpdFont.cpp
${REPO_ROOT}/lib/EpdFont/EpdFontFamily.cpp
+10
View File
@@ -0,0 +1,10 @@
// Link stubs for the adapter's SD-backed metric path. The suite's test
// families have no glyphMissCtx, so CpFontAdapter never calls into SdCardFont
// here — but the symbols must resolve, and SdCardFont.cpp itself needs
// Arduino/SD and cannot build on host.
#include <SdCardFont.h>
bool SdCardFont::hasGlyphMeta(uint8_t, uint32_t) const { return false; }
uint16_t SdCardFont::ensureAdvance(uint8_t, uint32_t) { return 0; }
uint8_t SdCardFont::styleIdxFromMissCtx(void*) { return 0; }
SdCardFont* SdCardFont::fromMissCtx(void*) { return nullptr; }