easyrip 4.8.2__tar.gz → 4.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {easyrip-4.8.2 → easyrip-4.9.0}/PKG-INFO +1 -1
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/global_val.py +1 -1
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/ripper/sub_and_font/font.py +0 -9
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/ripper/sub_and_font/subset.py +19 -13
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip.egg-info/PKG-INFO +1 -1
- {easyrip-4.8.2 → easyrip-4.9.0}/LICENSE +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/README.md +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/__init__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/__main__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_command.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_config/config.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_config/config_key.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_log.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_main.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_mlang/__init__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_mlang/global_lang_val.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_mlang/lang_en.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_mlang/lang_zh_Hans_CN.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_mlang/translator.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_prompt.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_web/__init__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_web/http_server.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/easyrip_web/third_party_api.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/ripper/media_info.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/ripper/param.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/ripper/ripper.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/ripper/sub_and_font/__init__.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/ripper/sub_and_font/ass.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip/utils.py +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip.egg-info/SOURCES.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip.egg-info/dependency_links.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip.egg-info/entry_points.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip.egg-info/requires.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/easyrip.egg-info/top_level.txt +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/pyproject.toml +0 -0
- {easyrip-4.8.2 → easyrip-4.9.0}/setup.cfg +0 -0
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
|
|
5
5
|
PROJECT_NAME = "Easy Rip"
|
|
6
|
-
PROJECT_VERSION = "4.
|
|
6
|
+
PROJECT_VERSION = "4.9.0"
|
|
7
7
|
PROJECT_TITLE = f"{PROJECT_NAME} v{PROJECT_VERSION}"
|
|
8
8
|
PROJECT_URL = "https://github.com/op200/EasyRip"
|
|
9
9
|
PROJECT_RELEASE_API = "https://api.github.com/repos/op200/EasyRip/releases/latest"
|
|
@@ -190,17 +190,8 @@ def subset_font(font: Font, subset_str: str, affix: str) -> tuple[TTFont, bool]:
|
|
|
190
190
|
|
|
191
191
|
# 创建子集化选项
|
|
192
192
|
options = subset.Options()
|
|
193
|
-
options.drop_tables = ["DSIG", "PCLT", "EBDT", "EBSC"] # 不移除任何可能有用的表
|
|
194
193
|
options.hinting = True # 保留 hinting
|
|
195
194
|
options.name_IDs = [] # 不保留 name 表记录
|
|
196
|
-
options.no_subset_tables = subset.Options._no_subset_tables_default + [
|
|
197
|
-
"BASE",
|
|
198
|
-
"mort",
|
|
199
|
-
]
|
|
200
|
-
# options.drop_tables = []
|
|
201
|
-
options.name_legacy = True
|
|
202
|
-
# options.retain_gids = True
|
|
203
|
-
options.layout_features = ["*"]
|
|
204
195
|
|
|
205
196
|
# 创建子集化器
|
|
206
197
|
subsetter = subset.Subsetter(options=options)
|
|
@@ -133,6 +133,7 @@ def subset(
|
|
|
133
133
|
current_font_sign: tuple[str, Font_type] = default_font_sign
|
|
134
134
|
for is_tag, text in Event_data.parse_text(event.Text, use_libass_spec):
|
|
135
135
|
if is_tag:
|
|
136
|
+
tag_fn_org: str | None = None
|
|
136
137
|
tag_fn: str | None = None
|
|
137
138
|
tag_bold: str | None = None
|
|
138
139
|
tag_italic: str | None = None
|
|
@@ -151,7 +152,7 @@ def subset(
|
|
|
151
152
|
|
|
152
153
|
match tag:
|
|
153
154
|
case "fn":
|
|
154
|
-
tag_fn = proc_value
|
|
155
|
+
tag_fn_org, tag_fn = value, proc_value
|
|
155
156
|
case "b":
|
|
156
157
|
tag_bold = proc_value
|
|
157
158
|
case "i":
|
|
@@ -183,7 +184,7 @@ def subset(
|
|
|
183
184
|
|
|
184
185
|
# 修改
|
|
185
186
|
text = text.replace(
|
|
186
|
-
f"\\fn{
|
|
187
|
+
f"\\fn{tag_fn_org}",
|
|
187
188
|
f"\\fn{'@' if _is_vertical else ''}{get_font_new_name(new_fontname)}",
|
|
188
189
|
)
|
|
189
190
|
|
|
@@ -309,44 +310,49 @@ def subset(
|
|
|
309
310
|
case Font_type.Regular:
|
|
310
311
|
if (
|
|
311
312
|
(_k := (key[0], Font_type.Bold)) in font_sign__font
|
|
312
|
-
or (_k := (key[0], Font_type.Bold_Italic)) in font_sign__font
|
|
313
313
|
or (_k := (key[0], Font_type.Italic)) in font_sign__font
|
|
314
|
+
or (_k := (key[0], Font_type.Bold_Italic)) in font_sign__font
|
|
314
315
|
):
|
|
315
316
|
_font = font_sign__font[_k]
|
|
316
317
|
|
|
317
318
|
case Font_type.Bold:
|
|
318
319
|
if (
|
|
319
|
-
(_k := (key[0], Font_type.
|
|
320
|
-
or (_k := (key[0], Font_type.
|
|
320
|
+
(_k := (key[0], Font_type.Regular)) in font_sign__font
|
|
321
|
+
or (_k := (key[0], Font_type.Bold_Italic)) in font_sign__font
|
|
321
322
|
or (_k := (key[0], Font_type.Italic)) in font_sign__font
|
|
322
323
|
):
|
|
323
324
|
_font = font_sign__font[_k]
|
|
324
325
|
|
|
325
326
|
case Font_type.Italic:
|
|
326
|
-
if (
|
|
327
|
-
_k := (key[0], Font_type.
|
|
328
|
-
|
|
327
|
+
if (
|
|
328
|
+
(_k := (key[0], Font_type.Regular)) in font_sign__font
|
|
329
|
+
or (_k := (key[0], Font_type.Bold_Italic)) in font_sign__font
|
|
330
|
+
or (_k := (key[0], Font_type.Bold)) in font_sign__font
|
|
331
|
+
):
|
|
329
332
|
_font = font_sign__font[_k]
|
|
330
333
|
|
|
331
334
|
case Font_type.Bold_Italic:
|
|
332
|
-
if (
|
|
333
|
-
_k := (key[0], Font_type.
|
|
334
|
-
|
|
335
|
+
if (
|
|
336
|
+
(_k := (key[0], Font_type.Bold)) in font_sign__font
|
|
337
|
+
or (_k := (key[0], Font_type.Italic)) in font_sign__font
|
|
338
|
+
or (_k := (key[0], Font_type.Regular)) in font_sign__font
|
|
339
|
+
):
|
|
335
340
|
_font = font_sign__font[_k]
|
|
336
341
|
|
|
337
342
|
# 模糊字重也找不到字体
|
|
338
343
|
if _font is None:
|
|
344
|
+
_want_font_sign_str = f"( {key[0]} / {key[1].name} )"
|
|
339
345
|
if (_f_low := key[0].lower()) in family_lower__family:
|
|
340
346
|
log.error(
|
|
341
347
|
"{} not found. Skip it. Perhaps you want the {}",
|
|
342
|
-
|
|
348
|
+
_want_font_sign_str,
|
|
343
349
|
f"'{family_lower__family[_f_low]}'",
|
|
344
350
|
deep=strict,
|
|
345
351
|
)
|
|
346
352
|
else:
|
|
347
353
|
log.error(
|
|
348
354
|
"{} not found. Skip it",
|
|
349
|
-
|
|
355
|
+
_want_font_sign_str,
|
|
350
356
|
deep=strict,
|
|
351
357
|
)
|
|
352
358
|
return_res = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|