Skip to content

Commit

Permalink
Merge pull request #49 from fferegrino/fix-font-paths
Browse files Browse the repository at this point in the history
Fix how we read the fonts from the package
fferegrino authored Dec 3, 2023
2 parents d99ba65 + d5c4320 commit f9ceb17
Showing 2 changed files with 2 additions and 2 deletions.
Empty file added b_roller/fonts/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions b_roller/youtube.py
Original file line number Diff line number Diff line change
@@ -72,8 +72,8 @@ def make_watermark(watermark_text: str):
padding = 20
img = Image.new("RGBA", (1, 1), back_ground_color)
draw = ImageDraw.Draw(img)
font_path = importlib_resources.path("b_roller.fonts", "Oswald-Medium.ttf")
font = ImageFont.truetype(str(font_path), font_size)
with importlib_resources.path("b_roller.fonts", "Oswald-Medium.ttf") as font_path:
font = ImageFont.truetype(str(font_path), font_size)

(top, left, bottom, right) = draw.textbbox((0, 0), watermark_text, font=font)

0 comments on commit f9ceb17

Please sign in to comment.