@@ -155,7 +155,7 @@ def test_ink_annotation(tmp_path):
155
155
assert_pdf_equal (pdf , HERE / "ink_annotation.pdf" , tmp_path )
156
156
157
157
158
- def test_free_text_annotation (tmp_path ):
158
+ def test_free_text_annotation_all_parameters (tmp_path ):
159
159
pdf = FPDF ()
160
160
pdf .add_page ()
161
161
pdf .set_font ("Helvetica" , size = 24 )
@@ -169,4 +169,24 @@ def test_free_text_annotation(tmp_path):
169
169
w = 150 ,
170
170
h = 15 ,
171
171
)
172
- assert_pdf_equal (pdf , HERE / "free_text_annotation.pdf" , tmp_path )
172
+ assert_pdf_equal (pdf , HERE / "free_text_annotation_all_parameters.pdf" , tmp_path )
173
+
174
+
175
+ def test_free_text_annotation_text_parameter (tmp_path ):
176
+ pdf = FPDF ()
177
+ pdf .add_page ()
178
+ pdf .set_font ("Helvetica" , size = 24 )
179
+ pdf .text (x = 50 , y = 50 , text = "Some text." )
180
+ pdf .set_font_size (12 )
181
+ pdf .free_text_annotation (text = "This is a free text annotation." )
182
+ assert_pdf_equal (pdf , HERE / "free_text_annotation_text_parameter.pdf" , tmp_path )
183
+
184
+
185
+ def test_free_text_annotation_width_parameter (tmp_path ):
186
+ pdf = FPDF ()
187
+ pdf .add_page ()
188
+ pdf .set_font ("Helvetica" , size = 24 )
189
+ pdf .text (x = 50 , y = 50 , text = "Some text." )
190
+ pdf .set_font_size (12 )
191
+ pdf .free_text_annotation (text = "This is a free text annotation." , w = 80 )
192
+ assert_pdf_equal (pdf , HERE / "free_text_annotation_width_parameter.pdf" , tmp_path )
0 commit comments