Skip to content

Commit

Permalink
Merge pull request #23 from 21isenough/new-font
Browse files Browse the repository at this point in the history
New font
  • Loading branch information
21isenough authored Jul 7, 2020
2 parents e49b8d8 + e18000a commit 18942d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions display.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,16 @@ def update_amount_screen():
(11, 10),
str("{:,}".format(math.floor(config.SATS))) + " sats",
fill=config.BLACK,
font=utils.create_font("freemono", 27),
font=utils.create_font("dotmbold", 27),
)
draw.text(
(13, 37),
"%.2f" % round(config.FIAT, 2) + " " + config.conf["atm"]["cur"].upper(),
fill=config.BLACK,
font=utils.create_font("freemono", 19),
font=utils.create_font("dotmbold", 19),
)
draw.text(
(11, 60), "Rate", fill=config.BLACK, font=utils.create_font("freemono", 14),
(11, 60), "Rate", fill=config.BLACK, font=utils.create_font("freemonobold", 14),
)
draw.text(
(60, 60),
Expand All @@ -396,10 +396,10 @@ def update_amount_screen():
+ " sats/"
+ config.conf["atm"]["centname"],
fill=config.BLACK,
font=utils.create_font("freemono", 14),
font=utils.create_font("freemonobold", 14),
)
draw.text(
(11, 75), "Fee", fill=config.BLACK, font=utils.create_font("freemono", 14),
(11, 75), "Fee", fill=config.BLACK, font=utils.create_font("freemonobold", 14),
)
draw.text(
(60, 75),
Expand All @@ -409,7 +409,7 @@ def update_amount_screen():
+ str(math.floor(config.SATSFEE))
+ " sats)",
fill=config.BLACK,
font=utils.create_font("freemono", 14),
font=utils.create_font("freemonobold", 14),
)

config.PAPIRUS.display(image)
Expand Down
Binary file added resources/fonts/DOTMBold.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ def create_font(font, size):
pathfreemono = Path.cwd().joinpath("resources", "fonts", "FreeMono.ttf")
pathfreemonobold = Path.cwd().joinpath("resources", "fonts", "FreeMonoBold.ttf")
pathsawasdee = Path.cwd().joinpath("resources", "fonts", "Sawasdee-Bold.ttf")
pathdotmbold = Path.cwd().joinpath("resources", "fonts", "DOTMBold.ttf")

if font == "freemono":
return ImageFont.truetype(pathfreemono.as_posix(), size)
if font == "freemonobold":
return ImageFont.truetype(pathfreemonobold.as_posix(), size)
if font == "sawasdee":
return ImageFont.truetype(pathsawasdee.as_posix(), size)
if font == "dotmbold":
return ImageFont.truetype(pathdotmbold.as_posix(), size)
else:
print("Font not available")

Expand Down

0 comments on commit 18942d6

Please sign in to comment.