Skip to content

Commit

Permalink
epub
Browse files Browse the repository at this point in the history
  • Loading branch information
nibazshab committed Dec 26, 2024
1 parent de505bc commit 97121c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions documents/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ a = a - b;

```css
{
writing-mode: vertical-rl; /* 竖向从右到左排列文字 */
overflow: hidden; /* 隐藏溢出部分 */
min-height: 100vh; /* 最小高度为整个屏幕 */
display: inline-block; /* 同一行显示的块级元素 */
Expand Down
8 changes: 6 additions & 2 deletions documents/epub.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ EPUB 实质上是一个可以解压的 zip 归档文件,使用 xhtml 规范编
- message.xhtml 制作信息
- prologue.xhtml 简介
- illustration.xhtml 彩插
- character.xhtml 人物介绍
- content.xhtml 目录
- x01.xhtml 第一话
- x02.xhtml 第二话
Expand Down Expand Up @@ -206,10 +207,13 @@ container.xml
import os
import re

fonts = "要提取的文字内容"
fonts = """
要提取的文字内容
"""

fonts = ''.join(set(re.sub(r'\s', '', fonts)))
os.system(
f'pyftsubset title.ttf --text={"".join(set(re.sub("\s", "", fonts)))} --output-file=title.min.ttf'
f'pyftsubset title.ttf --text={fonts} --output-file=title.min.ttf'
)
```

Expand Down

0 comments on commit 97121c4

Please sign in to comment.