| 58 | } |
| 59 | |
| 60 | bool FontDecompressor::decompressGroup(const EpdFontData* fontData, uint16_t groupIndex, uint8_t* outBuf, |
| 61 | uint32_t outSize) { |
| 62 | const EpdFontGroup& group = fontData->groups[groupIndex]; |
| 63 | |
| 64 | const uint32_t tDecomp = millis(); |
| 65 | inflateReader.init(false); |
| 66 | inflateReader.setSource(&fontData->bitmap[group.compressedOffset], group.compressedSize); |
| 67 | if (!inflateReader.read(outBuf, outSize)) { |
| 68 | stats.decompressTimeMs += millis() - tDecomp; |
| 69 | LOG_ERR("FDC", "Decompression failed for group %u", groupIndex); |
| 70 | return false; |
| 71 | } |
| 72 | stats.decompressTimeMs += millis() - tDecomp; |
| 73 | return true; |
| 74 | } |
| 75 | |
| 76 | // --- Byte-aligned helpers --- |
| 77 | |