From 71c0212fe52a3b9b341155b7bfcfc0b9a3f1d4c1 Mon Sep 17 00:00:00 2001 From: xhlove Date: Fri, 7 Feb 2020 19:27:13 +0800 Subject: [PATCH] bug fix --- README.md | 13 +++++++++++++ basic/ass.py | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cf8711e..7cf5dfc 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,19 @@ > -y或--y 覆盖原有弹幕而不提示 默认不使用 +- 字体配置文件(可选) +新建名为`config.json`的文件,内容形式如下: +```json +{ + "fonts_base_folder": "C:/Windows/Fonts", + "fonts": { + "微软雅黑":"msyh.ttc", + "微软雅黑粗体":"msyhbd.ttc", + "微软雅黑细体":"msyhl.ttc" + } +} +``` + # 效果示意(字幕与视频不相关) ![potplayer截屏](http://puui.qpic.cn/vshpic/0/5TLOX3WbgjudEj61IxYZ4tAuf2lFwl-ynf4S5T4sXkdjS9cd_0/0) [查看使用演示视频点我][2] diff --git a/basic/ass.py b/basic/ass.py index 73fb19c..410a448 100644 --- a/basic/ass.py +++ b/basic/ass.py @@ -3,7 +3,7 @@ ''' # 作者: weimo # 创建日期: 2020-01-04 19:14:46 -# 上次编辑时间 : 2020-02-07 18:33:14 +# 上次编辑时间 : 2020-02-07 19:21:19 # 一个人的命运啊,当然要靠自我奋斗,但是... ''' @@ -30,6 +30,7 @@ # ass_baseline = """Dialogue: 0,0:20:08.00,0:20:28.00,Default,,0,0,0,,{\t(1000,3000,\move(1300,600,360,600))\pos(676.571,506.629)}这是字幕内容示意""" def get_fonts_info(): + global fonts fonts_path = r"C:\Windows\Fonts" if os.path.exists("config.json"): with open("config.json", "r", encoding="utf-8") as f: