[Tkinter-discuss] Canvas.postscript() fails to render some fonts properly
ozgulfirat at gmail.com
Tue Aug 24 08:33:36 CEST 2010
In addition to my previous e-mail, I want to add the following link in which
there are some explanations and an example code for creating postscript.
However the following is only useful if you are into Tcl/Tk:
2010/8/23 Michael Lange <klappnase at web.de>
> Hello all,
> 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
> pack .c
> 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]
> update idletasks
> .c postscript -file "~/test.ps" -fontmap fontMap
> However this produces an obviously broken postscript file that cannot be
> If I omit the -fontmap option, the file can be opened, but I get a font
> 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
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tkinter-discuss