tags:

views:

38

answers:

1

I would like to have a GtkTextView in my (Python) program which shows text with the system monospace font. I found many ways which use an expicit font family name and size. However, I would like to use the system specified monospace font (e.g. from the ubuntu font preferences panel).

My program should be able to run on Windows as well as Linux without modifications, chosing automatically the right font.

to clarify, this is not what I want:

fontdesc = pango.FontDescription("Courier 18")
textview.modify_font(fontdesc)
+1  A: 

You can just use "monospace 18" as your font and it will use the system monospaced font.

ikanobori
what would I use, if I want the system default font size, too?
Just "monospace" I reckon.
ikanobori
you're right, it's working. That's something I could have thought of myself. Thanks!