|
@@ -304,12 +304,14 @@ def txt2image(content, save_target):
|
|
|
text_width, text_height = font.getsize(unicode_text)
|
|
|
canvas = Image.new('RGBA', (500, 500), (255, 0, 0, 0) )
|
|
|
draw = ImageDraw.Draw(canvas)
|
|
|
- text=''
|
|
|
+ text= content
|
|
|
+ '''
|
|
|
for c in unicode_text:
|
|
|
if len(re.findall(r'[\u4e00-\u9fff]+', c))>0:
|
|
|
text+=myunichchar(c)
|
|
|
else:
|
|
|
text+=c
|
|
|
+ '''
|
|
|
draw.text((5,5), text, (0, 0, 0), font)
|
|
|
canvas.save(save_target, "PNG")
|
|
|
|
|
@@ -638,7 +640,7 @@ def anchor_video_v2(name,text_content, image_urls):
|
|
|
sub_img_list[idx][sub_idx] = openshot.QtImageReader(sub_list[idx][sub_idx]['path'])
|
|
|
sub_img_list[idx][sub_idx].Open()
|
|
|
sub_duration = 0.3*sub_list[idx][sub_idx]['count']
|
|
|
- sub_clip_list[idx][sub_idx] = video_photo_clip(vid=sub_img_list[idx][sub_idx], layer=5, location_y=0.82,position=main_timer+sub_duration*sub_idx,end=sub_duration)
|
|
|
+ sub_clip_list[idx][sub_idx] = video_photo_clip(vid=sub_img_list[idx][sub_idx], layer=5, location_y=0.9,position=main_timer+sub_duration*sub_idx,end=sub_duration)
|
|
|
t.AddClip(sub_clip_list[idx][sub_idx])
|
|
|
sub_img_list[idx][sub_idx].Close()
|
|
|
|
|
@@ -679,7 +681,7 @@ def anchor_video_v2(name,text_content, image_urls):
|
|
|
|
|
|
title = openshot.QtImageReader(dir_title+name_hash+".png")
|
|
|
title.Open() # Open the reader
|
|
|
- title_clip = video_photo_clip(vid=title, layer=4, location_y=0.9,position=0,end=head_duration+main_timer)
|
|
|
+ title_clip = video_photo_clip(vid=title, layer=4, location_y=0.75,position=0,end=head_duration+main_timer)
|
|
|
t.AddClip(title_clip)
|
|
|
|
|
|
####start building
|