diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index 6e4df209b1f9..7e9e6dd78102 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -1089,6 +1089,7 @@ def __init__(self, c: str, state: ParserState): # The real width, height and depth will be set during the # pack phase, after we know the real fontsize self._update_metrics() + self._is_slanted = self._metrics.slanted def __repr__(self) -> str: return '`%s`' % self.c @@ -1104,7 +1105,7 @@ def _update_metrics(self) -> None: self.depth = -(metrics.iceberg - metrics.height) def is_slanted(self) -> bool: - return self._metrics.slanted + return self._is_slanted def get_kerning(self, next: Node | None) -> float: """