extend exception range to catch Matplotlib runtime errors
@@ -494,10 +494,10 @@ class MatplotlibFont(AbstractFont):
"""
if not text.strip():
return 0
- path = self._support_lib.get_text_path(text, self._font_properties)
try:
+ path = self._support_lib.get_text_path(text, self._font_properties)
return max(path.vertices[:, 0].tolist()) * self._width_factor
- except RuntimeError as e:
+ except Exception as e:
logger.error(f"Matplotlib RuntimeError: {str(e)}")
return 0
