Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e56525

Browse files
committed
MNT: Update rcParam code to match new text settings
1 parent 3344505 commit 5e56525

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

lib/matplotlib/rcsetup.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,8 +1762,19 @@ class _Param:
17621762
default="black",
17631763
validator=validate_color
17641764
),
1765-
_Param("text.hinting",
1766-
default="force_autohint",
1765+
_Param(
1766+
"text.language",
1767+
default=None,
1768+
validator=validate_string_or_None,
1769+
description="The language of the text in a format accepted by libraqm, namely "
1770+
"`a BCP47 language code "
1771+
"<https://www.w3.org/International/articles/language-tags/>`_. If "
1772+
"None, then no particular language will be implied, and default "
1773+
"font settings will be used."
1774+
),
1775+
_Param(
1776+
"text.hinting",
1777+
default="default",
17671778
validator=[
17681779
"default", "no_autohint", "force_autohint", "no_hinting", "auto", "native",
17691780
"either", "none",
@@ -1781,20 +1792,20 @@ class _Param:
17811792
),
17821793
_Param(
17831794
"text.hinting_factor",
1784-
default=8,
1795+
default=1,
17851796
validator=validate_int,
17861797
description="Specifies the amount of softness for hinting in the horizontal "
17871798
"direction. A value of 1 will hint to full pixels. A value of 2 "
17881799
"will hint to half pixels etc."
17891800
),
17901801
_Param(
17911802
"text.kerning_factor",
1792-
default=0,
1793-
validator=validate_int,
1794-
description="Specifies the scaling factor for kerning values. This is "
1795-
"provided solely to allow old test images to remain unchanged. "
1796-
"Set to 6 to obtain previous behavior. Values other than 0 or 6 "
1797-
"have no defined meaning."
1803+
default=None,
1804+
validator=validate_int_or_None,
1805+
description="[DEPRECATED] Specifies the scaling factor for kerning values. "
1806+
"This is provided solely to allow old test images to remain "
1807+
"unchanged. Set to 6 to obtain previous behavior. Values other "
1808+
"than 0 or 6 have no defined meaning."
17981809
),
17991810
_Param(
18001811
"text.antialiased",

lib/matplotlib/typing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@
451451
"text.hinting",
452452
"text.hinting_factor",
453453
"text.kerning_factor",
454+
"text.language",
454455
"text.latex.preamble",
455456
"text.parse_math",
456457
"text.usetex",

0 commit comments

Comments
 (0)