Skip to content

fix: stabilize reader and font generation#2

Merged
HelloRuru merged 3 commits into
HelloRuru:mainfrom
SamLaio:main
May 24, 2026
Merged

fix: stabilize reader and font generation#2
HelloRuru merged 3 commits into
HelloRuru:mainfrom
SamLaio:main

Conversation

@SamLaio
Copy link
Copy Markdown
Contributor

@SamLaio SamLaio commented May 24, 2026

Summary / 摘要

Type of change / 改動類型

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation only / 純文件
  • Refactor / 重構(不改變功能)
  • Build / tooling / config

Stage label / Stage 標籤

Proposed stage:

Affected branches / 影響的分支

  • stage7/epub-fast-open (繁中 main)
  • stage5.5/jianti (簡中 main)
  • stage12.5/* (current recommended)
  • stage11/jianti-with-jianguo (stageA, friendly fork)
  • Other:

Verified on hardware / 已實機驗證

  • Built successfully (繁中) — Flash usage: __%
  • Built successfully (簡中) — Flash usage: __%
  • Flashed to physical X4
  • Bluetooth page-turner test (which device?):
  • Large EPUB test (which book?):
  • No regression on previously-working features

Code checklist / 程式碼檢查

  • No hardcoded local paths (no C:\Users\...)
  • No API keys, tokens, or credentials
  • No personally-identifying info beyond the author byline
  • Comments where the why is non-obvious (not commenting the what)
  • If touching BluetoothHIDManager, tested re-pair flow with a real device
  • If touching lib/Epub/, tested with both small (<1MB) and large (>10MB) EPUBs
  • If touching lib/EpdFont/, regenerated affected .h files via fontconvert.py

Notes / 備註

SamLaio added 3 commits May 24, 2026 13:18
# Conflicts:
#	.gitignore
#	src/activities/home/HomeActivity.cpp
#	src/activities/reader/EpubReaderActivity.cpp
#	src/activities/reader/EpubReaderChapterSelectionActivity.cpp
@SamLaio SamLaio changed the title bugfix fix: stabilize reader and font generation May 24, 2026
@HelloRuru HelloRuru merged commit 4e1862e into HelloRuru:main May 24, 2026
1 of 2 checks passed
HelloRuru added a commit that referenced this pull request May 24, 2026
stage30 = stage29 + @SamLaio PR #2 上游同步 + HBTR003/Keykey 文件更正。
無新功能,純穩定化版本。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HelloRuru added a commit that referenced this pull request May 24, 2026
字體大瘦身(Flash 80.3% → 43.0%、省 2.4 MB):
- 砍 12pt / 17pt 字體(-10.9 MB),全韌體只用 1 個 10pt 字體
- 砍未使用的 jfopenhuninn_* / notosans_18_bold / ubuntu_10_bold 共 7 個檔
- all.h 只 include 10pt 一個字體

純 Python build pipeline(取代 freetype-based fontconvert.py):
- 新增 scripts/extract_glyphs.py:從壓縮完整 header 抽 glyph,跨 OS 穩定
- 重寫 scripts/build_ui_fonts.py:呼叫 extract_glyphs.py 取代 fontconvert.py
- 刪 scripts/generate_ui_charset.py + scripts/generate_ui_font_subset.py(合併入 build_ui_fonts.py)

完整字體池(一次性、commit 進 git):
- 新增 source_han_sans_tc_10_full.h.xz(543 KB,含 11658 字)
- 新增 _full_header_charset.txt(教育部 4808 + RIME 次常用 + 直排符號 + ASCII + 全形標點)
- 新增 _vertical_symbols.txt(48 個直排符號)

優點:
- 解決朋友 PR #2 想修的 Windows 字體 bug 根因(不再依賴 freetype)
- 速度快(純文字切 byte,10x 以上比解析 OTF 快)
- 輸出 deterministic(不會因 OS / Python 版本不同產生不同 diff)

每次 build 字集:教育部 4808 + RIME 次常用 + UI 三語 + ASCII + 全形標點 = 5400+ 字

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants