diff --git a/README.md b/README.md index 90bd245..a816074 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ - 🌓 日间/夜间/棕褐色模式切换 - 🎨 多种背景纹理(牛皮纸/稿纸/作文纸/自定义图片) - 📏 响应式分页引擎(基于 egui Galley 精确测量) +- 🔤 字体切换(内置三款中文字体:思源黑体 / 霞鹜文楷 / 思源宋体) - 🔗 内容锚点定位(字体/窗口大小变化后自动恢复阅读位置) - 📊 底部进度条可拖动跳转 - 💾 自动保存阅读位置 @@ -31,17 +32,19 @@ ``` epub-read/ ├── src/ -│ ├── main.rs # 程序入口 + 字体初始化 +│ ├── main.rs # 程序入口 │ ├── app.rs # App 状态管理 + 事件循环 │ ├── book.rs # ePub 解析 + 章节数据结构 │ ├── reader.rs # 响应式分页引擎 + 阅读视图渲染 │ ├── theme.rs # 主题/配色/设置/书签/阅读位置 │ ├── style.rs # 排版样式配置(对齐/行高/缩进) │ ├── texture.rs # 背景纹理生成 -│ ├── font.rs # 中文字体设置 +│ ├── font.rs # 字体注册/加载/切换 │ └── persistence.rs # 配置文件读写 ├── fonts/ -│ └── NotoSansSC-Regular.ttf # 内嵌中文字体 +│ ├── NotoSansSC-Regular.ttf # 思源黑体(内嵌) +│ ├── LXGWWenKai-Regular.ttf # 霞鹜文楷(运行时加载) +│ └── SourceHanSerifSC-Regular.otf # 思源宋体(运行时加载) ├── Cargo.toml └── .cargo/config.toml # 静态链接配置 ``` @@ -71,7 +74,7 @@ cargo build --release ### 静态链接说明 已配置 `.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) | | 文件对话框 | [rfd](https://crates.io/crates/rfd) | | 序列化 | [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 -cargo test # 运行测试(32 个) +cargo test # 运行测试(33 个) cargo check # 编译检查 cargo run # 调试运行 ``` diff --git a/main.png b/main.png index 3715ec5..012e1a2 100644 Binary files a/main.png and b/main.png differ