-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from lgbrownjr/development
Development
- Loading branch information
Showing
5 changed files
with
60 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/python3 | ||
|
||
# -*- coding:utf-8 -*- | ||
#import: | ||
#from PIL import Image, ImageDraw, ImageFont # Font handeling | ||
from waveshare_epd import epd2in13_V2 | ||
|
||
# Variable decleration | ||
epd = epd2in13_V2.EPD() | ||
#location | ||
left_margin = 1 #Left margin. | ||
top_margin = 11 #Will start all text at the 11th pixel | ||
bottom_margen = epd.width - 1 | ||
line_position = top_margin #initial line to start on. | ||
next_line_position = top_margin #initial line to start on.#location | ||
|
||
def center_text(draw,msg,font): | ||
w, h = draw.textsize(msg, font) | ||
starting_point = (epd.height/2) - (w/2) | ||
return (starting_point) | ||
|
||
def line_pos(new_page,draw,msg,font): | ||
global line_position | ||
global next_line_position | ||
w, h = draw.textsize(msg, font) | ||
if new_page is True: | ||
line_position = top_margin #initial line to start on. | ||
next_line_position = top_margin #initial line to start on.#location | ||
if next_line_position == top_margin: | ||
next_line_position = line_position + h | ||
return (line_position) | ||
else: | ||
line_position = next_line_position | ||
next_line_position = line_position + h | ||
return (line_position) | ||
#exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters