@@ -168,6 +168,9 @@ def test_ft2font_invalid_args(tmp_path):
168168 # kerning_factor argument.
169169 with pytest .raises (TypeError , match = 'incompatible constructor arguments' ):
170170 ft2font .FT2Font (file , _kerning_factor = 1.3 )
171+ with pytest .warns (mpl .MatplotlibDeprecationWarning ,
172+ match = 'text.kerning_factor rcParam was deprecated .+ 3.11' ):
173+ ft2font .FT2Font (file , _kerning_factor = 123 )
171174
172175
173176def test_ft2font_clear ():
@@ -188,7 +191,7 @@ def test_ft2font_clear():
188191
189192def test_ft2font_set_size ():
190193 file = fm .findfont ('DejaVu Sans' )
191- font = ft2font .FT2Font (file , hinting_factor = 1 , _kerning_factor = 1 )
194+ font = ft2font .FT2Font (file , hinting_factor = 1 )
192195 font .set_size (12 , 72 )
193196 font .set_text ('ABabCDcd' )
194197 orig = font .get_width_height ()
@@ -717,7 +720,7 @@ def test_ft2font_get_sfnt_table(font_name, header):
717720def test_ft2font_get_kerning (left , right , unscaled , unfitted , default ):
718721 file = fm .findfont ('DejaVu Sans' )
719722 # With unscaled, these settings should produce exact values found in FontForge.
720- font = ft2font .FT2Font (file , hinting_factor = 1 , _kerning_factor = 0 )
723+ font = ft2font .FT2Font (file , hinting_factor = 1 )
721724 font .set_size (100 , 100 )
722725 assert font .get_kerning (font .get_char_index (ord (left )),
723726 font .get_char_index (ord (right )),
@@ -756,7 +759,7 @@ def test_ft2font_get_kerning(left, right, unscaled, unfitted, default):
756759
757760def test_ft2font_set_text ():
758761 file = fm .findfont ('DejaVu Sans' )
759- font = ft2font .FT2Font (file , hinting_factor = 1 , _kerning_factor = 0 )
762+ font = ft2font .FT2Font (file , hinting_factor = 1 )
760763 font .set_size (12 , 72 )
761764 xys = font .set_text ('' )
762765 np .testing .assert_array_equal (xys , np .empty ((0 , 2 )))
@@ -778,7 +781,7 @@ def test_ft2font_set_text():
778781
779782def test_ft2font_loading ():
780783 file = fm .findfont ('DejaVu Sans' )
781- font = ft2font .FT2Font (file , hinting_factor = 1 , _kerning_factor = 0 )
784+ font = ft2font .FT2Font (file , hinting_factor = 1 )
782785 font .set_size (12 , 72 )
783786 for glyph in [font .load_char (ord ('M' )),
784787 font .load_glyph (font .get_char_index (ord ('M' )))]:
@@ -819,13 +822,13 @@ def test_ft2font_drawing():
819822 ])
820823 expected *= 255
821824 file = fm .findfont ('DejaVu Sans' )
822- font = ft2font .FT2Font (file , hinting_factor = 1 , _kerning_factor = 0 )
825+ font = ft2font .FT2Font (file , hinting_factor = 1 )
823826 font .set_size (12 , 72 )
824827 font .set_text ('M' )
825828 font .draw_glyphs_to_bitmap (antialiased = False )
826829 image = font .get_image ()
827830 np .testing .assert_array_equal (image , expected )
828- font = ft2font .FT2Font (file , hinting_factor = 1 , _kerning_factor = 0 )
831+ font = ft2font .FT2Font (file , hinting_factor = 1 )
829832 font .set_size (12 , 72 )
830833 glyph = font .load_char (ord ('M' ))
831834 image = np .zeros (expected .shape , np .uint8 )
@@ -835,7 +838,7 @@ def test_ft2font_drawing():
835838
836839def test_ft2font_get_path ():
837840 file = fm .findfont ('DejaVu Sans' )
838- font = ft2font .FT2Font (file , hinting_factor = 1 , _kerning_factor = 0 )
841+ font = ft2font .FT2Font (file , hinting_factor = 1 )
839842 font .set_size (12 , 72 )
840843 vertices , codes = font .get_path ()
841844 assert vertices .shape == (0 , 2 )
0 commit comments