I am having trouble with changing the font in turtle. I want the font to be Comic Sans, but when I run this code the text is in Arial:
write("Turtle Racer", align="center", font=("Comic Sans", 80, "normal"))
What fonts are available for turtle?
I am having trouble with changing the font in turtle. I want the font to be Comic Sans, but when I run this code the text is in Arial:
write("Turtle Racer", align="center", font=("Comic Sans", 80, "normal"))
What fonts are available for turtle?
This works on my system:
import turtle
turtle.write("Turtle Racer", align="center", font=("Comic Sans MS", 80, "normal"))
turtle.done()
And is consistent with the family name returned by the code @hop left a link to in the comments.
to use a font, it has to be the name as seen in say - word, so as opposed to Comic Sans, it would be, as previously stated - comic Sans MS
The below code works in my system. I have included the screen class to help visualize and for you to test it out.
from turtle import Turtle, Screen
screen = Screen()
t = Turtle()
t.hideturtle()
t.write(arg="Your Text", align="left", font=("Comic Sans", 10, "normal"))
screen.exitonclick()
If I see your code, you may have missed to call the object on which the write method is being called.