[Python] Python Arcade 3.3.0 not using custom font loaded from TTF file

Discussão em 'Python' iniciado por Stack, Agosto 18, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to load a custom font from a .ttf file into my Python program using the Arcade library, like so:

    arcade.load_font("Assets/Fonts/CopperplateGothic.ttf")

    self.actionsLabel = arcade.Text("Actions", font_name="CopperplateGothicStd-32BC", color=highlightColour, font_size=32, x=0, y=buttonY+buttonHeight+20, batch=self.headingTexts)

    print(self.actionsLabel.font_name)


    The call to arcade.load_font doesn't produce an exception, so the font appears to be loaded correctly. However, the font isn't actually used when displaying the self.actionsLabel.

    I've tried these values for font_name in the arcade.Text constructor:

    • The name as shown in the Windows font viewer, "Copperplate Std 32 BC" (this is also how the font appears in the font selector in other programs).
    • The name as shown in the properties of the font file, "CopperplateGothicStd-32BC"
    • The filename, with and without the extension.

    But none of these work; the text simply appears in a fallback font (Segoe UI). However, using the name "MS Comic Sans" chooses that font, as expected, so the problem must be somewhere else.

    I also tried converting the font file to OpenType first, to no avail.

    How can I use a font that I've loaded explicitly in the code, rather than one pre-installed in the system?

    Continue reading...

Compartilhe esta Página