1
$\begingroup$

I have been troubles setting up my default font in my script. I have tried , bpy.ops.font.open(filepath="C:\\Windows\\Fonts\\comic.ttf"), but the result font is another one.

Does someone know the path?

$\endgroup$

1 Answer 1

1
$\begingroup$

That is the correct path on Windows, but Python require uses backslash ('\') as a special character, so you can either write the string as r"C:\Windows\Fonts\comic.ttf" or as C:\\Windows\\Fonts\\comic.ttf. That is, you can either use the r prefix to tell Python to not use backslash as a special character or you can "escape" the backslash by typing it twice wherever you want it once.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .