[Tkinter-discuss] Canvas.postscript() fails to render some fonts properly
klappnase at web.de
Mon Aug 23 22:23:19 CEST 2010
I am stuck here with a strange problem creating postscript from a
Tkinter Canvas (the OS is debian linux).
I found that Canvas.postscript() fails to render some fonts correctly and
uses something like helvetica or courier (I guess) instead. From what the
canvas man page says, I thought I should try to add a fontmap to the
postscript() command, but I cannot seem to get it working, and I am not
sure if it is because of improper use of the fontmap option or if
something else is wrong.
>From the few Tcl resources I could find I tried to set up a minimal tcl
example, trying to find out how the "fontmap" works, because I could not
find any useful Python resources:
canvas .c -width 300 -height 300 -bg white
set fonty [font create -family "comic sans ms" -size 16]
.c create text 20 20 -font $fonty -text "ich wollt ich waer ein huhn" -anchor nw
set fontMap($fonty) [list "comic sans ms" 16]
.c postscript -file "~/test.ps" -fontmap fontMap
However this produces an obviously broken postscript file that cannot be opened.
If I omit the -fontmap option, the file can be opened, but I get a font like
helvetica or so.
Does anyone have a clue on this?
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
"Life and death are seldom logical."
"But attaining a desired goal always is."
-- McCoy and Spock, "The Galileo Seven", stardate 2821.7
More information about the Tkinter-discuss