def test_write_text_box_object_justification_smoke_test(self):
     image = Image.new("RGB", (1000, 1000))
     draw = ImageDraw.Draw(image)
     vertices = [(0, 0), (200, 0), (200, 100), (0, 100)]
     width = 200
     height = 100
     box = TextBox(vertices, width, height)
     for horiz_just in ["left", "center", "right"]:
         for vert_just in ["top", "center", "bottom"]:
             TextBoxDrawer.write_text_box_object(
                 image,
                 draw,
                 box,
                 "This is a string",
                 horiz_just=horiz_just,
                 vert_just=vert_just,
             )
     with translation.override("he"):
         for horiz_just in ["left", "center", "right"]:
             for vert_just in ["top", "center", "bottom"]:
                 TextBoxDrawer.write_text_box_object(
                     image,
                     draw,
                     box,
                     "עברית‬",
                     horiz_just=horiz_just,
                     vert_just=vert_just,
                 )
 def test_write_text_box_object_defaults_smoke_test(self):
     image = Image.new("RGB", (1000, 1000))
     draw = ImageDraw.Draw(image)
     vertices = [(0, 0), (200, 0), (200, 100), (0, 100)]
     width = 200
     height = 100
     box = TextBox(vertices, width, height)
     TextBoxDrawer.write_text_box_object(
         image,
         draw,
         box,
         "This is a string",
     )
 def test_write_text_box_object_rotated_smoke_test(self):
     image = Image.new("RGB", (1000, 1000))
     draw = ImageDraw.Draw(image)
     vertices = [(0, 200), (0, 0), (100, 0), (100, 200)]
     width = 200
     height = 100
     rotation = 90
     box = TextBox(vertices, width, height, angle=rotation)
     TextBoxDrawer.write_text_box_object(
         image,
         draw,
         box,
         "This is a string",
     )
 def test_write_text_box_object_params_smoke_test(self):
     image = Image.new("RGB", (1000, 1000))
     draw = ImageDraw.Draw(image)
     vertices = [(0, 0), (200, 0), (200, 100), (0, 100)]
     width = 200
     height = 100
     box = TextBox(vertices, width, height)
     TextBoxDrawer.write_text_box_object(
         image,
         draw,
         box,
         "This is a string",
         font_path="static/fonts/PatrickHand-Regular",
         font_size=17,
         line_spacing=10,
         color="#013291")