Skip to content

Commit

Permalink
formatted comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvoss committed Apr 28, 2024
1 parent 40dafc3 commit 360bacc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions material/plugins/social/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,10 @@ def _fetch_font_from_google_fonts(self, family: str):
with requests.get(match) as res:
res.raise_for_status()

# Extract font family name and style
# using the content in the response via ByteIO to avoid writing
# a temp file. Done to fix problems with passing a
# NamedTemporaryFile to ImageFont.truetype() on Windows,
# see https://t.ly/LiF_k
# Extract font family name and style using the content in the
# response via ByteIO to avoid writing a temp file. Done to fix
# problems with passing a NamedTemporaryFile to
# ImageFont.truetype() on Windows, see https://t.ly/LiF_k
with BytesIO(res.content) as fontdata:
font = ImageFont.truetype(fontdata)
name, style = font.getname()
Expand Down
9 changes: 4 additions & 5 deletions src/plugins/social/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,10 @@ def _fetch_font_from_google_fonts(self, family: str):
with requests.get(match) as res:
res.raise_for_status()

# Extract font family name and style
# using the content in the response via ByteIO to avoid writing
# a temp file. Done to fix problems with passing a
# NamedTemporaryFile to ImageFont.truetype() on Windows,
# see https://t.ly/LiF_k
# Extract font family name and style using the content in the
# response via ByteIO to avoid writing a temp file. Done to fix
# problems with passing a NamedTemporaryFile to
# ImageFont.truetype() on Windows, see https://t.ly/LiF_k
with BytesIO(res.content) as fontdata:
font = ImageFont.truetype(fontdata)
name, style = font.getname()
Expand Down

0 comments on commit 360bacc

Please sign in to comment.