Skip to content

Commit

Permalink
Merge pull request #50 from lyusupov/master
Browse files Browse the repository at this point in the history
fix candidate for an issue of that a font size argument is not passed to the framebuf layer
  • Loading branch information
makermelissa committed Mar 29, 2021
2 parents e55b9be + f0d6f5f commit 3e1546d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adafruit_epd/epd.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,15 @@ def line(self, x_0, y_0, x_1, y_1, color): # pylint: disable=too-many-arguments
"""Draw a line from (x_0, y_0) to (x_1, y_1) in passed color"""
self._color_dup("line", (x_0, y_0, x_1, y_1), color)

def text(self, string, x, y, color, *, font_name="font5x8.bin"):
def text(self, string, x, y, color, *, font_name="font5x8.bin", size=1):
"""Write text string at location (x, y) in given color, using font file"""
if self._blackframebuf is self._colorframebuf: # monochrome
self._blackframebuf.text(
string,
x,
y,
font_name=font_name,
size=size,
color=(color != Adafruit_EPD.WHITE) != self._black_inverted,
)
else:
Expand All @@ -287,13 +288,15 @@ def text(self, string, x, y, color, *, font_name="font5x8.bin"):
x,
y,
font_name=font_name,
size=size,
color=(color == Adafruit_EPD.BLACK) != self._black_inverted,
)
self._colorframebuf.text(
string,
x,
y,
font_name=font_name,
size=size,
color=(color == Adafruit_EPD.RED) != self._color_inverted,
)

Expand Down

0 comments on commit 3e1546d

Please sign in to comment.