|
@@ -301,14 +301,23 @@ def file_prepare_v2(name, name_hash,text_content,image_urls):
|
|
|
|
|
|
def txt2image(content, save_target):
|
|
|
unicode_text = trim_punctuation(content)
|
|
|
- font = ImageFont.truetype(font="msjh.ttf", size=30)
|
|
|
+ font = ImageFont.truetype(font="DFT_B7.ttc", size=30)
|
|
|
text_width, text_height = font.getsize(unicode_text)
|
|
|
canvas = Image.new('RGBA', (700, 500), (255, 0, 0, 0) )
|
|
|
draw = ImageDraw.Draw(canvas)
|
|
|
text= unicode_text
|
|
|
draw.text((5,5), text, (255, 255, 0), font)
|
|
|
canvas.save(save_target, "PNG")
|
|
|
-
|
|
|
+def txt2image_title(content, save_target):
|
|
|
+ unicode_text = trim_punctuation(content)
|
|
|
+ font = ImageFont.truetype(font="DFT_B7.ttc", size=30)
|
|
|
+ text_width, text_height = font.getsize(unicode_text)
|
|
|
+ canvas = Image.new('RGBA', (700, 500), (255, 0, 0, 0) )
|
|
|
+ draw = ImageDraw.Draw(canvas)
|
|
|
+ text= unicode_text
|
|
|
+ draw.text((5,5), text, (255, 255, 0), font)
|
|
|
+ canvas.save(save_target, "PNG")
|
|
|
+'''
|
|
|
def txt2image_title(content, save_target):
|
|
|
unicode_text =content
|
|
|
font = ImageFont.truetype("font.ttf", 23,encoding='big5')
|
|
@@ -323,7 +332,7 @@ def txt2image_title(content, save_target):
|
|
|
text+=c
|
|
|
draw.text((5,5), text, (17, 41, 167), font)
|
|
|
canvas.save(save_target, "PNG")
|
|
|
-
|
|
|
+'''
|
|
|
def call_achor_video_v2(fileName):
|
|
|
conn = rpyc.classic.connect("192.168.1.105",18812)
|
|
|
ros = conn.modules.os
|