Hello,
Thus spoketh Firat Ozgul <[email protected]>
unto us on Tue, 24 Aug 2010 12:37:41 +0300:
> Hello,
>
> It seems to me that for the most part, you are having issues with font
> names that have spaces between the words making up the font name. For
> example: "DejaVu Sans Condensed"
>
> If there are spaces between words, you should define self.font as a
> tuple:
>
> self.font = ("DejaVu Sans Condensed",)
I know that, otherwise Tk will complain "expected an integer but got
'sans'" or so :)
I thought it might have something to do with the spaces first, too, but
as I mentioned "andale mono" or "penguin attack" work, wheras "clean" or
"avantgarde" don't.
>
> Note the trailing comma in accordance with the rules of creating a
> one-element tuple...
>
> Although it is not mandatory, you would better use the exact same cases
> (uppercase vs lowercase) for the fonts as seen from the output of:
>
> [code]
> root = Tk()
> root.tk.call("font", "families")
> [/code]
>
I already used the font names this way, here I get all lower case variants
of all font names (like "dejavu sans") from tkFont.families().
I am really baffled with this (o.O)
I tried some more with the fontmap, I changed the font in your example
into:
self.font = tkFont.Font(family="courier", weight='normal', size=43)
and changed the first lines of create_ps() into:
root.tk.call("set", "fontMap(%s)" % self.font, ('verdana-bold', 43))
self.ps = self.canvas.postscript(fontmap='fontMap')
however if I change "verdana-bold" into "verdana" or "verdana-normal" it does
*not* work and the postscript uses "courier" (as seen on the screen).
I was not able yet to add a font name containing white space to the fontmap
though :(
Regards
Michael
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
No one may kill a man. Not for any purpose. It cannot be condoned.
-- Kirk, "Spock's Brain", stardate 5431.6
_______________________________________________
Tkinter-discuss mailing list
[email protected]
http://mail.python.org/mailman/listinfo/tkinter-discuss