docs: update README with font selection feature and three fonts

This commit is contained in:
Developer
2026-05-16 22:31:30 +08:00
parent 3c54cc1e55
commit afa8ea6ce7
2 changed files with 9 additions and 6 deletions

View File

@@ -20,6 +20,7 @@
- 🌓 日间/夜间/棕褐色模式切换 - 🌓 日间/夜间/棕褐色模式切换
- 🎨 多种背景纹理(牛皮纸/稿纸/作文纸/自定义图片) - 🎨 多种背景纹理(牛皮纸/稿纸/作文纸/自定义图片)
- 📏 响应式分页引擎(基于 egui Galley 精确测量) - 📏 响应式分页引擎(基于 egui Galley 精确测量)
- 🔤 字体切换(内置三款中文字体:思源黑体 / 霞鹜文楷 / 思源宋体)
- 🔗 内容锚点定位(字体/窗口大小变化后自动恢复阅读位置) - 🔗 内容锚点定位(字体/窗口大小变化后自动恢复阅读位置)
- 📊 底部进度条可拖动跳转 - 📊 底部进度条可拖动跳转
- 💾 自动保存阅读位置 - 💾 自动保存阅读位置
@@ -31,17 +32,19 @@
``` ```
epub-read/ epub-read/
├── src/ ├── src/
│ ├── main.rs # 程序入口 + 字体初始化 │ ├── main.rs # 程序入口
│ ├── app.rs # App 状态管理 + 事件循环 │ ├── app.rs # App 状态管理 + 事件循环
│ ├── book.rs # ePub 解析 + 章节数据结构 │ ├── book.rs # ePub 解析 + 章节数据结构
│ ├── reader.rs # 响应式分页引擎 + 阅读视图渲染 │ ├── reader.rs # 响应式分页引擎 + 阅读视图渲染
│ ├── theme.rs # 主题/配色/设置/书签/阅读位置 │ ├── theme.rs # 主题/配色/设置/书签/阅读位置
│ ├── style.rs # 排版样式配置(对齐/行高/缩进) │ ├── style.rs # 排版样式配置(对齐/行高/缩进)
│ ├── texture.rs # 背景纹理生成 │ ├── texture.rs # 背景纹理生成
│ ├── font.rs # 中文字体设置 │ ├── font.rs # 字体注册/加载/切换
│ └── persistence.rs # 配置文件读写 │ └── persistence.rs # 配置文件读写
├── fonts/ ├── fonts/
── NotoSansSC-Regular.ttf # 内嵌中文字体 ── NotoSansSC-Regular.ttf # 思源黑体(内嵌)
│ ├── LXGWWenKai-Regular.ttf # 霞鹜文楷(运行时加载)
│ └── SourceHanSerifSC-Regular.otf # 思源宋体(运行时加载)
├── Cargo.toml ├── Cargo.toml
└── .cargo/config.toml # 静态链接配置 └── .cargo/config.toml # 静态链接配置
``` ```
@@ -71,7 +74,7 @@ cargo build --release
### 静态链接说明 ### 静态链接说明
已配置 `.cargo/config.toml` 启用 `+crt-static`,编译出的 exe 不依赖 MinGW 运行时 DLL。 已配置 `.cargo/config.toml` 启用 `+crt-static`,编译出的 exe 不依赖 MinGW 运行时 DLL。
内嵌 Noto Sans SC 中文字体(约 17MB确保中文正常显示 内嵌 Noto Sans SC 中文字体(思源黑体),额外两款字体(霞鹜文楷、思源宋体)放在 exe 同级 `fonts/` 目录运行时加载
## 技术栈 ## 技术栈
@@ -81,12 +84,12 @@ cargo build --release
| ePub 解析 | [epub](https://crates.io/crates/epub) | | ePub 解析 | [epub](https://crates.io/crates/epub) |
| 文件对话框 | [rfd](https://crates.io/crates/rfd) | | 文件对话框 | [rfd](https://crates.io/crates/rfd) |
| 序列化 | [serde](https://crates.io/crates/serde) / [serde_json](https://crates.io/crates/serde_json) | | 序列化 | [serde](https://crates.io/crates/serde) / [serde_json](https://crates.io/crates/serde_json) |
| 中文字体 | [Noto Sans SC](https://fonts.google.com/specimen/Noto+Sans+SC) | | 中文字体 | 思源黑体 / [霞鹜文楷](https://github.com/lxgw/LxgwWenkai-Lite) / [思源宋体](https://github.com/adobe-fonts/source-han-serif) |
## 开发 ## 开发
```bash ```bash
cargo test # 运行测试32 个) cargo test # 运行测试33 个)
cargo check # 编译检查 cargo check # 编译检查
cargo run # 调试运行 cargo run # 调试运行
``` ```

BIN
main.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 KiB

After

Width:  |  Height:  |  Size: 941 KiB