Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- Reversing a brightness or warmth drag partway now moves the level past where it started instead of stopping there.
- Idle power saving now puts the device into automatic light sleep between loop ticks instead of only lowering the CPU clock, cutting idle draw while leaving buttons, touch, and the frontlight working exactly as before. The screen, Wi-Fi transfers, and USB sessions stay awake while they are in use.
- GitHub workflows and release documentation links now follow the `development` default branch.
- The built-in Bitter and Lexend Deca TTF fonts carry only the ligature and kerning data the reader uses, freeing about 290 KB of flash on ESP32-S3 builds. Text renders the same.
- Idle power saving now engages after 250 ms instead of 3 seconds, and battery level is polled every 6 seconds instead of every 1.5, trading slightly less frequent battery updates for lower average power draw.
- The Library opens instantly when nothing on the SD card has changed since its last scan, instead of rescanning the whole card on every visit. Moving the selection no longer re-reads each visible book from the card.
- After a restart, Home starts indexing the Library in the background as soon as it appears, so the first Library visit usually opens without the "Reading your books" wait. Indexing pauses the moment you press a button or touch the screen and picks up where it left off.
Expand Down
Binary file modified lib/EpdFont/scalableFonts/bitter_bold.ttf
Binary file not shown.
Binary file modified lib/EpdFont/scalableFonts/bitter_bolditalic.ttf
Binary file not shown.
Binary file modified lib/EpdFont/scalableFonts/bitter_italic.ttf
Binary file not shown.
Binary file modified lib/EpdFont/scalableFonts/bitter_regular.ttf
Binary file not shown.
Binary file modified lib/EpdFont/scalableFonts/lexenddeca_bold.ttf
Binary file not shown.
Binary file modified lib/EpdFont/scalableFonts/lexenddeca_bolditalic.ttf
Binary file not shown.
Binary file modified lib/EpdFont/scalableFonts/lexenddeca_italic.ttf
Binary file not shown.
Binary file modified lib/EpdFont/scalableFonts/lexenddeca_regular.ttf
Binary file not shown.
39 changes: 39 additions & 0 deletions scripts/subset_scalable_fonts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Strip the embedded reader TTFs down to the tables FreeInkFont reads.

The firmware only looks up GSUB liga/rlig (lib/ScalableFont/ScalableGsub.h) and
GPOS kern (freeink-sdk/libs/font/FreeInkFont/src/Gpos.cpp). Every other layout
feature (small caps, old-style figures, mark positioning, ...) is dead weight in
flash. Run after replacing a font in lib/EpdFont/scalableFonts; safe to re-run.

Requires fonttools (pip install fonttools).
"""
from pathlib import Path

from fontTools import subset
from fontTools.ttLib import TTFont

FEATURES = ['liga', 'rlig', 'kern']


def main():
source = Path(__file__).resolve().parents[1] / 'lib/EpdFont/scalableFonts'
options = subset.Options()
options.layout_features = FEATURES
options.name_IDs = ['*'] # keep copyright and license strings
options.name_languages = ['*']
options.hinting = False
options.drop_tables += ['DSIG', 'STAT']
options.notdef_outline = True
for filename in (source / 'manifest.txt').read_text().splitlines():
path = source / filename
before = path.stat().st_size
font = TTFont(path)
subsetter = subset.Subsetter(options)
subsetter.populate(unicodes=font.getBestCmap().keys())
subsetter.subset(font)
font.save(path)
print(f'{filename:28} {before:>7} B -> {path.stat().st_size:>7} B')


if __name__ == '__main__':
main()
Loading