Changing font with Canvas.text style_args?
in OpenSesame
I'm trying to display a Text object on a Canvas in Verdana. I think that the correct way to do this is the style_args argument, but I'm struggling to find an example of that in the documentation. I would be very happy to be pointed in the right direction!
What I've got is:
my_canvas = Canvas()
my_canvas['text'] = Text('Verdana?',
y = instruction_start_y,
style_args = {'font_family' : 'verdana', 'font_size' : 30})
my_canvas.show()
But it doesn't have the effect that I want.
Comments
Hi @mattm ,
These arguments are simply additional keywords, like so:
my_canvas['text'] = Text( 'Verdana?', y=instruction_start_y, font_family='verdana', font_size=30 )Hope this helps!
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Ah awesome, thanks!