Browse Source

增加字体

zhangyong 1 năm trước cách đây
mục cha
commit
4358bf12a4
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      video_stitching/video_stitching.py

+ 2 - 2
video_stitching/video_stitching.py

@@ -191,7 +191,7 @@ class VideoStitching():
                     end = editor.cvsecs(end)
                 text = cls.split_text(text, 10)
                 # /System/Library/Fonts/Hiragino Sans GB.ttc 本地字体
-                sub = editor.TextClip(text,
+                sub = editor.TextClip(text, font="/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",
                                       fontsize=30, color="black").set_duration(end - start).set_start(
                     start).set_position(
                     ("center", final_height - 80)).set_opacity(0.8)
@@ -201,7 +201,7 @@ class VideoStitching():
             video_with_subtitles = editor.CompositeVideoClip([final_clip] + subtitle_clips)
         else:
             text_clip = (
-                editor.TextClip("分享、转发给群友", 
+                editor.TextClip("分享、转发给群友", font="/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",
                                 fontsize=30, color="black").
                     set_position(("center", final_height - 80)).
                     set_duration(duration_limit).