Your Name 4 years ago
parent
commit
01848c3258
2 changed files with 20 additions and 3 deletions
  1. 5 3
      tests/fonttest.py
  2. 15 0
      tests/openshottest.py

+ 5 - 3
tests/fonttest.py

@@ -3,7 +3,9 @@ from PIL import Image,ImageDraw,ImageFont
 unicode_text = "這是一段中文測試"
 #font = ImageFont.truetype("c:/portable/fonts/華康綜藝體.ttf", 40,encoding='big5')
 #font = ImageFont.truetype("c:/portable/fonts/華康綜藝體.ttf", 40,encoding='big5')
-font = ImageFont.truetype("/var/fonts/adv.ttf", 40,encoding='big5')
+
+font = ImageFont.truetype("c:/portable/fonts/adv.ttf", 40,encoding='big5')
+#font = ImageFont.truetype("/var/fonts/adv.ttf", 40,encoding='big5')
 
 text_width, text_height = font.getsize(unicode_text)
 
@@ -23,8 +25,8 @@ text=''
 for c in unicode_text:
     text+=myunichchar(c)
 #text=myunichchar('中')+myunichchar('文')+myunichchar('測')+myunichchar('試')
-draw.text((5,5), text, (255, 0, 0), font)
+draw.text((5,5), text, (255, 255, 255), font)
 
 # save the blank canvas to a file
-canvas.save("unicode-text.png", "PNG")
+canvas.save("/var/txt/title.png", "PNG")
 canvas.show()

+ 15 - 0
tests/openshottest.py

@@ -116,6 +116,18 @@ c5.Layer(4)
 t.AddClip(c5)
 
 
+txt1 = openshot.QtImageReader("/var/bk.jpg")
+
+c1 = openshot.Clip(lower)
+c1.has_audio=openshot.Keyframe(0)
+
+c1.Layer(2)
+
+c1.Position(3.03)
+c1.Start=0
+t.AddClip(c1)
+
+
 
 #c3 = openshot.Clip(r2)
 #c3.Layer(4)
@@ -126,6 +138,9 @@ t.AddClip(c5)
 #t.AddClip(c3)
 
 
+
+
+
 for n in range(800):
 # print(n, end=" ", flush=1)
  f=t.GetFrame(n)