From 934c380c4b78a1336d953871a56b7778d0e5327f Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 16 Aug 2021 16:01:13 -0500 Subject: [PATCH 1/2] bitmap property for bitmap_label --- adafruit_display_text/bitmap_label.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adafruit_display_text/bitmap_label.py b/adafruit_display_text/bitmap_label.py index a613039..2ef4a72 100755 --- a/adafruit_display_text/bitmap_label.py +++ b/adafruit_display_text/bitmap_label.py @@ -534,3 +534,8 @@ def _set_label_direction(self, new_label_direction: str) -> None: def _get_valid_label_directions(self) -> Tuple[str, ...]: return "LTR", "RTL", "UPD", "UPR", "DWR" + + @property + def bitmap(self): + """The Bitmap object that the text and background are drawn into.""" + return self._bitmap From 9563ef0e8809540e9b1a88bbc588ffe2542c145d Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 16 Aug 2021 18:44:59 -0500 Subject: [PATCH 2/2] type links in the docstrings for bitmap label. --- adafruit_display_text/bitmap_label.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/adafruit_display_text/bitmap_label.py b/adafruit_display_text/bitmap_label.py index 2ef4a72..fc6716b 100755 --- a/adafruit_display_text/bitmap_label.py +++ b/adafruit_display_text/bitmap_label.py @@ -39,8 +39,8 @@ class Label(LabelBase): """A label displaying a string of text that is stored in a bitmap. - Note: This ``bitmap_label.py`` library utilizes a bitmap to display the text. - This method is memory-conserving relative to ``label.py``. + Note: This ``bitmap_label.py`` library utilizes a :py:class:`~displayio.Bitmap` + to display the text. This method is memory-conserving relative to ``label.py``. For further reduction in memory usage, set ``save_text=False`` (text string will not be stored and ``line_spacing`` and ``font`` are immutable with ``save_text`` @@ -537,5 +537,9 @@ def _get_valid_label_directions(self) -> Tuple[str, ...]: @property def bitmap(self): - """The Bitmap object that the text and background are drawn into.""" + """ + The Bitmap object that the text and background are drawn into. + + :rtype: displayio.Bitmap + """ return self._bitmap