Skip to content

Changing fonts of a card

ContestedWheel edited this page Sep 21, 2025 · 6 revisions

A common question that I see getting passed around in some servers is "How do I change the font of my card?". A different font in a card is more commonly seen in bots with the CarFigures engine, but in this tutorial we will be implementing it into Ballsdex.

Finding and opening the file

  1. Open your bot folder in File Explorer and go to ballsdex/core/image_generator

The directory that you are in now should look like this:

image

  1. Open the image_gen.py file in your text editor of choice.

You will see the following lines in the file:

title_font = ImageFont.truetype(str(SOURCES_PATH / "ArsenicaTrial-Extrabold.ttf"), 170)
capacity_name_font = ImageFont.truetype(str(SOURCES_PATH / "Bobby Jones Soft.otf"), 110)
capacity_description_font = ImageFont.truetype(str(SOURCES_PATH / "OpenSans-Semibold.ttf"), 75)
stats_font = ImageFont.truetype(str(SOURCES_PATH / "Bobby Jones Soft.otf"), 130)
credits_font = ImageFont.truetype(str(SOURCES_PATH / "arial.ttf"), 40)

These lines are self explanatory, but just in case you don't get them:

  • title_font is the font of your ball's short name at the top of the card.

  • capacity_name_font is the font of your ball's ability name.

  • capacity_description_font is the font of your ball's ability description.

  • stats_font is the font of the text that shows you how much HP and attack your ball has.

  • credits_font is the font of the "Created by: El Laggron" and "Artwork author:" text.

Downloading fonts and placing them inside the code

dafont, font.download, and Google Fonts are websites that I personally used for getting my own fonts and had no problem with them. Give them a try and see if you like any fonts!

It is also your choice which part of the card's font you would like to change, you do not need to replace the fonts for every part of the card.

Tip

If you already know the name of the font you want, just simply search the name of it and see if you can download it.

After finding and downloading a font you like, put the font file in the src folder located in the image_generator folder.

Go back to the image_gen.py file in your text editor and change the file name of the font in the code to the one you downloaded.

For example, if I downloaded the Lemon Milk Medium font to replace the current font of the title, I would edit the title_font line to say this:

title_font = ImageFont.truetype(str(SOURCES_PATH / "LEMONMILK-Medium.otf"), 170)

Important

Make sure to include the file extension of the font file at the end, otherwise the bot will be unable to find the font. Font file extensions are usually .otf or .tff.

Save your changes once you are done, and restart using docker compose restart. Once your bot is back up, test how the card looks by using /balls info.

If you don't like how the font looks, try using a different one. Looking for a good font consists of trial and error, so you might have to spend more time trying different fonts.

Clone this wiki locally