Spaces:
Sleeping
Sleeping
Commit
·
35e2d47
1
Parent(s):
1a69cfc
bugfix: fix minor bugs
Browse files
utils/completion_reward.py
CHANGED
|
@@ -482,6 +482,9 @@ class ImageProcessor:
|
|
| 482 |
tmp_img = Image.new("RGBA", img.size, (0, 0, 0, 0))
|
| 483 |
draw = ImageDraw.Draw(tmp_img)
|
| 484 |
|
|
|
|
|
|
|
|
|
|
| 485 |
# Calculate space required by the paragraph
|
| 486 |
paragraph_height = 0
|
| 487 |
for line in paragraph.split("\n"):
|
|
@@ -490,6 +493,7 @@ class ImageProcessor:
|
|
| 490 |
line_height = draw.textsize(wrapped_line, font=body_font)[1]
|
| 491 |
paragraph_height += line_height + 25
|
| 492 |
|
|
|
|
| 493 |
# Draw the box
|
| 494 |
padding = 40
|
| 495 |
left, right = 50, img.width - 50
|
|
@@ -511,10 +515,6 @@ class ImageProcessor:
|
|
| 511 |
|
| 512 |
draw = ImageDraw.Draw(img)
|
| 513 |
|
| 514 |
-
# Draw the text
|
| 515 |
-
title_font = ImageFont.truetype("NotoSansTC-Bold.ttf", 34)
|
| 516 |
-
body_font = ImageFont.truetype("NotoSansTC-Light.ttf", 14)
|
| 517 |
-
|
| 518 |
# Title text
|
| 519 |
title = f"光束守護者 - {player_name} 的冒險故事"
|
| 520 |
title_x, title_y = left + 20, top + 20 # Adjust padding as needed
|
|
|
|
| 482 |
tmp_img = Image.new("RGBA", img.size, (0, 0, 0, 0))
|
| 483 |
draw = ImageDraw.Draw(tmp_img)
|
| 484 |
|
| 485 |
+
# Draw the text
|
| 486 |
+
title_font = ImageFont.truetype("NotoSansTC-Bold.ttf", 34)
|
| 487 |
+
body_font = ImageFont.truetype("NotoSansTC-Light.ttf", 14)
|
| 488 |
# Calculate space required by the paragraph
|
| 489 |
paragraph_height = 0
|
| 490 |
for line in paragraph.split("\n"):
|
|
|
|
| 493 |
line_height = draw.textsize(wrapped_line, font=body_font)[1]
|
| 494 |
paragraph_height += line_height + 25
|
| 495 |
|
| 496 |
+
|
| 497 |
# Draw the box
|
| 498 |
padding = 40
|
| 499 |
left, right = 50, img.width - 50
|
|
|
|
| 515 |
|
| 516 |
draw = ImageDraw.Draw(img)
|
| 517 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 518 |
# Title text
|
| 519 |
title = f"光束守護者 - {player_name} 的冒險故事"
|
| 520 |
title_x, title_y = left + 20, top + 20 # Adjust padding as needed
|