@@ -1731,11 +1731,11 @@ def is_opentype_cff_font(filename):
17311731
17321732
17331733@lru_cache (64 )
1734- def _get_font (font_filepaths , hinting_factor , * , _kerning_factor , thread_id ,
1734+ def _get_font (font_filepaths , * , _kerning_factor , thread_id ,
17351735 enable_last_resort ):
17361736 (first_fontpath , first_fontindex ), * rest = font_filepaths
17371737 fallback_list = [
1738- ft2font .FT2Font (fpath , hinting_factor , face_index = index ,
1738+ ft2font .FT2Font (fpath , face_index = index ,
17391739 _kerning_factor = _kerning_factor )
17401740 for fpath , index in rest
17411741 ]
@@ -1749,12 +1749,12 @@ def _get_font(font_filepaths, hinting_factor, *, _kerning_factor, thread_id,
17491749 # already in the list.
17501750 if enable_last_resort :
17511751 fallback_list .append (
1752- ft2font .FT2Font (last_resort_path , hinting_factor ,
1752+ ft2font .FT2Font (last_resort_path ,
17531753 _kerning_factor = _kerning_factor ,
17541754 _warn_if_used = True ))
17551755 last_resort_index = len (fallback_list )
17561756 font = ft2font .FT2Font (
1757- first_fontpath , hinting_factor , face_index = first_fontindex ,
1757+ first_fontpath , face_index = first_fontindex ,
17581758 _fallback_list = fallback_list ,
17591759 _kerning_factor = _kerning_factor
17601760 )
@@ -1783,6 +1783,7 @@ def _cached_realpath(path):
17831783 return os .path .realpath (path )
17841784
17851785
1786+ @_api .delete_parameter ('3.11' , 'hinting_factor' )
17861787def get_font (font_filepaths , hinting_factor = None ):
17871788 """
17881789 Get an `.ft2font.FT2Font` object given a list of file paths.
@@ -1816,20 +1817,16 @@ def get_font(font_filepaths, hinting_factor=None):
18161817 if isinstance (fname , FontPath ) else (_cached_realpath (fname ), 0 )
18171818 for fname in font_filepaths )
18181819
1819- hinting_factor = mpl ._val_or_rc (hinting_factor , 'text.hinting_factor' )
1820-
18211820 font = _get_font (
18221821 # must be a tuple to be cached
18231822 paths ,
1824- hinting_factor ,
18251823 _kerning_factor = mpl .rcParams ['text.kerning_factor' ],
18261824 # also key on the thread ID to prevent segfaults with multi-threading
18271825 thread_id = threading .get_ident (),
18281826 enable_last_resort = mpl .rcParams ['font.enable_last_resort' ],
18291827 )
18301828 # Ensure the transform is always consistent.
1831- font ._set_transform ([[round (0x10000 / font ._hinting_factor ), 0 ], [0 , 0x10000 ]],
1832- [0 , 0 ])
1829+ font ._set_transform ([[0x10000 , 0 ], [0 , 0x10000 ]], [0 , 0 ])
18331830 return font
18341831
18351832
0 commit comments