Skip to content

Update epd.py #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions adafruit_epd/epd.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,29 +289,29 @@ 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"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a sentence about size to the comment. In particular, what are the units?

if self._blackframebuf is self._colorframebuf: # monochrome
self._blackframebuf.text(
string,
x,
y,
y, size=size,
font_name=font_name,
color=(color != Adafruit_EPD.WHITE) != self._black_inverted,
)
else:
self._blackframebuf.text(
string,
x,
y,
y, size=size,
font_name=font_name,
color=(color == Adafruit_EPD.BLACK) != self._black_inverted,
)
self._colorframebuf.text(
string,
x,
y,
font_name=font_name,
font_name=font_name, size=size,
color=(color == Adafruit_EPD.RED) != self._color_inverted,
)

Expand Down