Backup: Stable state with EPUB reader fixes (Freeze, OOM, Speed, State, Tooling)

This commit is contained in:
Antigravity Agent
2026-01-19 18:44:45 -05:00
parent 21277e03eb
commit 1237f01ac2
34 changed files with 1600 additions and 192 deletions

View File

@@ -1,13 +1,13 @@
#include "EpdFontFamily.h"
const EpdFont* EpdFontFamily::getFont(const Style style) const {
if (style == BOLD && bold) {
if (style == EpdFontStyles::BOLD && bold) {
return bold;
}
if (style == ITALIC && italic) {
if (style == EpdFontStyles::ITALIC && italic) {
return italic;
}
if (style == BOLD_ITALIC) {
if (style == EpdFontStyles::BOLD_ITALIC) {
if (boldItalic) {
return boldItalic;
}
@@ -23,15 +23,24 @@ const EpdFont* EpdFontFamily::getFont(const Style style) const {
}
void EpdFontFamily::getTextDimensions(const char* string, int* w, int* h, const Style style) const {
getFont(style)->getTextDimensions(string, w, h);
getFont(style)->getTextDimensions(string, w, h, style);
}
bool EpdFontFamily::hasPrintableChars(const char* string, const Style style) const {
return getFont(style)->hasPrintableChars(string);
return getFont(style)->hasPrintableChars(string, style);
}
const EpdFontData* EpdFontFamily::getData(const Style style) const { return getFont(style)->data; }
const EpdFontData* EpdFontFamily::getData(const Style style) const {
const EpdFont* font = getFont(style);
return font ? font->getData(style) : nullptr;
}
const EpdGlyph* EpdFontFamily::getGlyph(const uint32_t cp, const Style style) const {
return getFont(style)->getGlyph(cp);
};
const EpdFont* font = getFont(style);
return font ? font->getGlyph(cp, style) : nullptr;
}
const uint8_t* EpdFontFamily::loadGlyphBitmap(const EpdGlyph* glyph, uint8_t* buffer, const Style style) const {
const EpdFont* font = getFont(style);
return font ? font->loadGlyphBitmap(glyph, buffer, style) : nullptr;
}