diff --git a/adafruit_display_text/__init__.py b/adafruit_display_text/__init__.py index 270e25f..2ae8ca2 100755 --- a/adafruit_display_text/__init__.py +++ b/adafruit_display_text/__init__.py @@ -246,7 +246,6 @@ def __init__( tab_replacement: Tuple[int, str] = (4, " "), label_direction: str = "LTR", verbose: bool = False, - **kwargs, # pylint: disable=unused-argument ) -> None: # pylint: disable=too-many-arguments, too-many-locals @@ -271,9 +270,6 @@ def __init__( self._tab_text = self._tab_replacement[1] * self._tab_replacement[0] self._verbose = verbose - if "max_glyphs" in kwargs: - print("Please update your code: 'max_glyphs' is not needed anymore.") - self._ascent, self._descent = self._get_ascent_descent() self._bounding_box = None diff --git a/adafruit_display_text/bitmap_label.py b/adafruit_display_text/bitmap_label.py index ad6ea5f..997eb02 100755 --- a/adafruit_display_text/bitmap_label.py +++ b/adafruit_display_text/bitmap_label.py @@ -292,15 +292,18 @@ def _line_spacing_ypixels(font: FontProtocol, line_spacing: float) -> int: def _text_bounding_box( self, text: str, font: FontProtocol ) -> Tuple[int, int, int, int, int, int]: - # pylint: disable=too-many-locals + # pylint: disable=too-many-locals,too-many-branches - ascender_max, descender_max = self._ascent, self._descent + bbox = font.get_bounding_box() + if len(bbox) == 4: + ascender_max, descender_max = bbox[1], -bbox[3] + else: + ascender_max, descender_max = self._ascent, self._descent lines = 1 - xposition = ( - x_start - ) = yposition = y_start = 0 # starting x and y position (left margin) + # starting x and y position (left margin) + xposition = x_start = yposition = y_start = 0 left = None right = x_start
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: