0

For a class I am trying to create a blackjack game which will be visually displayed using turtle. I want to import a special font that renders cards rather than having to draw the cards using turtle commands. I have researched this for several hours, but I have been unable to find an answer that works for my case. How would I go about getting a custom font (.ttf format) to render using the write() function of turtle?

turtle.penup()
turtle.setx(200)
turtle.sety(200)
turtle.pendown()
turtle.write('A', font = ("CARDS", 12, "normal"))

EDIT: The font that I want to import is called CARDS.TTF I currently have the font located in the folder where I have the .py file of the function saved

  • Is your font named "CARDS"? Where is the `.ttf` file stored? – martineau Feb 17 '19 at 01:24
  • Since `turtle` uses `tkinter` internally to do graphics, [this answer](https://stackoverflow.com/questions/11993290/truly-custom-font-in-tkinter/30631309#30631309) may be helpful. – martineau Feb 17 '19 at 01:37

0 Answers0