AmusementClub / AssFontSubset

使用 fonttools 生成 ASS 字幕文件的字体子集,并自动修改字体名称及 ASS 文件中对应的字体名称
185 stars 4 forks source link

v2无法识别非系统语言的字体本地化名称 #18

Closed scrpr closed 2 months ago

scrpr commented 3 months ago

程序版本

v2.0.3

问题描述

使用思源黑体/宋体 TC时,程序无法识别其本地化名称“思源黑體”与“思源宋體”。 由于使用命令行,尝试chcp 65001,问题依旧。

使用旧版 (V1)时未发生报错,可正常进行子集化。

复现步骤

字幕文件:0.4.2

运行命令:assfontsubset.exe --fonts fonts ep4_tc.ass

日志

> assfontsubset --fonts fonts ep4_tc.ass
2024-07-29T02:27:44+08:00|INF|Start scan valid font files in [redacted]
2024-07-29T02:27:44+08:00|INF|Support font file extension: .ttf, .otf, .ttc, otc
2024-07-29T02:27:44+08:00|INF|Start parse font info from ass files
2024-07-29T02:27:44+08:00|INF|0pen ass file: [redacted]
2024-07-29T02:27:44+08:00|INF|File use Unicode (UTF-8) and LF
2024-07-29T02:27:44+08:00|INF|Start parse ass
2024-07-29T02:27:44+08:00|INF|Start parse section [Script Info]
2024-07-29T02:27:44+08:00|INF|Start parse section [Aegisub Project Garbage]
2024-07-29T02:27:44+08:00|INF|Start parse section [V4+ Styles]
2024-07-29T02:27:44+08:00|INF|Start parse section [Events]
2024-07-29T02:27:44+08:00|INF|Ass parsing completed
2024-07-29T02:27:44+08:00|INF|Ass font info parsing completed, use 43 ms
2024-07-29T02:27:44+08:00|INF|Start generate subset font info
2024-07-29T02:27:44+08:00|WRN|FOT-TsukuARdGothic Std E use \b1 will not get faux bold
2024-07-29T02:27:44+08:00|WRN|思源黑体 Heavy use \b1 will not get faux bold
2024-07-29T02:27:44+08:00|WRN|Source Han Serif use \b1 will not get faux bold
2024-07-29T02:27:44+08:00|WRN|思源宋体 use \b1 will not get faux bold
2024-07-29T02:27:44+08:00|WRN|獅尾圆體SC-Bold use \b1 wi1l not get faux bold 
2024-07-29T02:27:44+08:00|WRN|獅尾圆體-Black use \b1 will not get faux bold
2024-B7-29T02:27:44+08:00|ERR|One or more errors occurred.(Not found font file: 思源黑體,0,0、思源黑體 Medium,0,0、@思
源宋體,1,0、思源宋體,1,8)
2024-07-29T02:27:44+08:00|INF|Press Any key to exit
> assfontsubset ep4_tc.ass --debug
2024-07-29T07:11:23+08:00|INF|Start scan valid font files in [redacted]\fonts
2024-07-29T07:11:23+08:00|INF|Support font file extension: .ttf, .otf, .ttc, otc
2024-07-29T07:11:23+08:00|DBG|Font file scanning completed, use 4 ms
2024-07-29T07:11:23+08:00|INF|Start parse font info from ass files
2024-07-29T07:11:23+08:00|INF|Open ass file: [redacted]\ep4_tc.ass
2024-07-29T07:11:23+08:00|INF|File use Unicode (UTF-8) and LF
2024-07-29T07:11:23+08:00|INF|Start parse ass
2024-07-29T07:11:23+08:00|INF|Start parse section [Script Info]
2024-07-29T07:11:23+08:00|DBG|Line 2 is a key-pair, key Title parse completed
2024-07-29T07:11:23+08:00|DBG|Line 3 is a key-pair, key ScriptType parse completed
2024-07-29T07:11:23+08:00|DBG|Line 4 is a key-pair, key WrapStyle parse completed
2024-07-29T07:11:23+08:00|DBG|Line 5 is a key-pair, key ScaledBorderAndShadow parse completed
2024-07-29T07:11:23+08:00|DBG|Line 6 is a key-pair, key YCbCr Matrix parse completed
2024-07-29T07:11:23+08:00|DBG|Line 7 is a key-pair, key PlayResX parse completed
2024-07-29T07:11:23+08:00|DBG|Line 8 is a key-pair, key PlayResY parse completed
2024-07-29T07:11:23+08:00|INF|Start parse section [Aegisub Project Garbage]
2024-07-29T07:11:23+08:00|INF|Start parse section [V4+ Styles]
2024-07-29T07:11:23+08:00|DBG|Line 22 is a format line, parse completed
2024-07-29T07:11:23+08:00|DBG|Line 23 is a style line, parse completed, style name is SIKANOKO_Bottom
2024-07-29T07:11:23+08:00|DBG|Line 24 is a style line, parse completed, style name is SIKANOKO_Top
2024-07-29T07:11:23+08:00|DBG|Line 25 is a style line, parse completed, style name is TITLE
2024-07-29T07:11:23+08:00|DBG|Line 26 is a style line, parse completed, style name is STF
2024-07-29T07:11:23+08:00|DBG|Line 27 is a style line, parse completed, style name is OnScreen_OP
2024-07-29T07:11:23+08:00|DBG|Line 28 is a style line, parse completed, style name is OP
2024-07-29T07:11:23+08:00|DBG|Line 29 is a style line, parse completed, style name is OP_CN
2024-07-29T07:11:23+08:00|DBG|Line 30 is a style line, parse completed, style name is ED
2024-07-29T07:11:23+08:00|DBG|Line 31 is a style line, parse completed, style name is ED_CN
2024-07-29T07:11:23+08:00|DBG|Line 32 is a style line, parse completed, style name is Insert_CN
2024-07-29T07:11:23+08:00|DBG|Line 33 is a style line, parse completed, style name is Insert_JP
2024-07-29T07:11:23+08:00|DBG|Line 34 is a style line, parse completed, style name is Insert_karaoke
2024-07-29T07:11:23+08:00|DBG|Line 35 is a style line, parse completed, style name is OnScreen
2024-07-29T07:11:23+08:00|INF|Start parse section [Events]
2024-07-29T07:11:23+08:00|DBG|Parse format line fine
2024-07-29T07:11:23+08:00|INF|Ass parsing completed
2024-07-29T07:11:23+08:00|INF|Ass font info parsing completed, use 41 ms
2024-07-29T07:11:23+08:00|INF|Start generate subset font info
2024-07-29T07:11:23+08:00|DBG|Start match font file info and ass font info
2024-07-29T07:11:23+08:00|DBG|Try match FOT-TsukuARdGothic Std E,1,0 and FOT-TsukuARdGothic Std E_w800_b0_i0
2024-07-29T07:11:23+08:00|WRN|FOT-TsukuARdGothic Std E use \b1 will not get faux bold
2024-07-29T07:11:23+08:00|DBG|FOT-TsukuARdGothic Std E,1,0 match [redacted]\fonts\FOT-TsukuARdGothicStd-E.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 筑紫A丸 SC,1,0 and FOT-TsukuARdGothic SC_w700_b1_i0
2024-07-29T07:11:23+08:00|DBG|筑紫A丸 SC,1,0 match [redacted]\fonts\FOTTsukuARdGothicSC-Bold.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match MiSans,0,0 and MiSans_w630_b1_i0
2024-07-29T07:11:23+08:00|DBG|Try match MiSans,0,0 and MiSans_w330_b0_i0
2024-07-29T07:11:23+08:00|DBG|MiSans,0,0 match [redacted]\fonts\MiSans-Regular.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match @MiSans,0,0 and MiSans_w630_b1_i0
2024-07-29T07:11:23+08:00|DBG|Try match @MiSans,0,0 and MiSans_w330_b0_i0
2024-07-29T07:11:23+08:00|DBG|@MiSans,0,0 match [redacted]\fonts\MiSans-Regular.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match @MiSans,1,0 and MiSans_w630_b1_i0
2024-07-29T07:11:23+08:00|DBG|@MiSans,1,0 match [redacted]\fonts\MiSans-Bold.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match @MiSans Demibold,0,0 and MiSans Demibold_w450_b0_i0
2024-07-29T07:11:23+08:00|DBG|@MiSans Demibold,0,0 match [redacted]\fonts\MiSans-Demibold.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match Source Han Sans Heavy,0,0 and Source Han Sans Heavy_w900_b0_i0
2024-07-29T07:11:23+08:00|DBG|Source Han Sans Heavy,0,0 match [redacted]\fonts\SourceHanSans-Heavy.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 思源黑体,1,0 and Source Han Sans SC_w700_b1_i0
2024-07-29T07:11:23+08:00|DBG|思源黑体,1,0 match [redacted]\fonts\SourceHanSansSC-Bold.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 思源黑体 Heavy,1,0 and Source Han Sans SC Heavy_w900_b0_i0
2024-07-29T07:11:23+08:00|WRN|思源黑体 Heavy use \b1 will not get faux bold
2024-07-29T07:11:23+08:00|DBG|思源黑体 Heavy,1,0 match [redacted]\fonts\SourceHanSansSC-Heavy.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match Source Han Sans TC,1,0 and Source Han Sans TC_w700_b1_i0
2024-07-29T07:11:23+08:00|DBG|Source Han Sans TC,1,0 match [redacted]\fonts\SourceHanSansTC-Bold.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match Source Han Sans TC,0,0 and Source Han Sans TC_w700_b1_i0
2024-07-29T07:11:23+08:00|DBG|Try match Source Han Sans TC,0,0 and Source Han Sans TC_w400_b0_i0
2024-07-29T07:11:23+08:00|DBG|Source Han Sans TC,0,0 match [redacted]\fonts\SourceHanSansTC-Regular.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match Source Han Sans TC Heavy,0,0 and Source Han Sans TC Heavy_w900_b0_i0
2024-07-29T07:11:23+08:00|DBG|Source Han Sans TC Heavy,0,0 match [redacted]\fonts\SourceHanSansTC-Heavy.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match Source Han Serif,1,0 and Source Han Serif_w700_b1_i0
2024-07-29T07:11:23+08:00|WRN|Source Han Serif use \b1 will not get faux bold
2024-07-29T07:11:23+08:00|DBG|Source Han Serif,1,0 match [redacted]\fonts\SourceHanSerif-Bold.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 思源宋体,1,0 and Source Han Serif SC_w700_b1_i0
2024-07-29T07:11:23+08:00|WRN|思源宋体 use \b1 will not get faux bold
2024-07-29T07:11:23+08:00|DBG|思源宋体,1,0 match [redacted]\fonts\SourceHanSerifSC-Bold.otf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 獅尾圓體JP-Bold,0,0 and Swei Gothic CJK JP_w700_b0_i0
2024-07-29T07:11:23+08:00|DBG|獅尾圓體JP-Bold,0,0 match [redacted]\fonts\SweiGothicCJKjp-Bold.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 獅尾圓體SC-Black,0,0 and Swei Gothic CJK SC Black_w900_b0_i0
2024-07-29T07:11:23+08:00|DBG|獅尾圓體SC-Black,0,0 match [redacted]\fonts\SweiGothicCJKsc-Black.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 獅尾圓體SC-Bold,0,0 and Swei Gothic CJK SC Bold_w700_b1_i0
2024-07-29T07:11:23+08:00|DBG|獅尾圓體SC-Bold,0,0 match [redacted]\fonts\SweiGothicCJKsc-Bold.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 獅尾圓體SC-Bold,1,0 and Swei Gothic CJK SC Bold_w700_b1_i0
2024-07-29T07:11:23+08:00|WRN|獅尾圓體SC-Bold use \b1 will not get faux bold
2024-07-29T07:11:23+08:00|DBG|獅尾圓體SC-Bold,1,0 match [redacted]\fonts\SweiGothicCJKsc-Bold.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 獅尾圓體-Black,1,0 and Swei Gothic CJK TC Black_w900_b0_i0
2024-07-29T07:11:23+08:00|WRN|獅尾圓體-Black use \b1 will not get faux bold
2024-07-29T07:11:23+08:00|DBG|獅尾圓體-Black,1,0 match [redacted]\fonts\SweiGothicCJKtc-Black.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 獅尾圓體-Black,0,0 and Swei Gothic CJK TC Black_w900_b0_i0
2024-07-29T07:11:23+08:00|DBG|獅尾圓體-Black,0,0 match [redacted]\fonts\SweiGothicCJKtc-Black.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 獅尾圓體-Bold,0,0 and Swei Gothic CJK TC Bold_w700_b0_i0
2024-07-29T07:11:23+08:00|DBG|獅尾圓體-Bold,0,0 match [redacted]\fonts\SweiGothicCJKtc-Bold.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 悠哉字体,1,0 and Yozai_w700_b1_i0
2024-07-29T07:11:23+08:00|DBG|悠哉字体,1,0 match [redacted]\fonts\Yozai-Bold.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Try match 悠哉字体,0,0 and Yozai_w700_b1_i0
2024-07-29T07:11:23+08:00|DBG|Try match 悠哉字体,0,0 and Yozai_w400_b0_i0
2024-07-29T07:11:23+08:00|DBG|悠哉字体,0,0 match [redacted]\fonts\Yozai-Regular.ttf index 0
2024-07-29T07:11:23+08:00|DBG|Match completed
2024-07-29T07:11:23+08:00|ERR|One or more errors occurred. (Not found font file: 思源黑體,0,0、思源黑體 Medium,0,0、@思 源宋體,1,0、思源宋體,1,0)
2024-07-29T07:11:23+08:00|INF|Press Any key to exit
MIRIMIRIM commented 3 months ago

尝试下 https://github.com/AmusementClub/AssFontSubset/actions/runs/10147838090

scrpr commented 2 months ago

尝试下 https://github.com/AmusementClub/AssFontSubset/actions/runs/10147838090

成功修复