Skip to content

Commit

Permalink
[Colour] Use ImageFont.load_default
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreusada committed Mar 24, 2024
1 parent eb4ed7c commit 0540b40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions colour/colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Colour(commands.Cog):
"""View information about a colour."""

__author__ = "Kreusada"
__version__ = "1.1.0"
__version__ = "1.1.1"

def format_help_for_context(self, ctx: commands.Context) -> str:
context = super().format_help_for_context(ctx)
Expand All @@ -43,7 +43,7 @@ def generate_image(
) -> io.BytesIO:
img = Image.new("RGB", (1500, 500), colour.to_rgb())
drawer = ImageDraw.Draw(img)
font = ImageFont.truetype("arial.ttf", 100)
font = ImageFont.load_default(size=100)
drawer.text((10, 0), name, fill=constrast, font=font)
l, t, r, b = drawer.textbbox((10, 0), name, font=font)
cimg = img.crop([l - 10, t - 10, r + 10, b + 10])
Expand Down

0 comments on commit 0540b40

Please sign in to comment.