[Tkinter-discuss] Canvas.postscript() fails to render some fonts properly

Michael Lange klappnase at web.de
Tue Aug 24 22:29:18 CEST 2010


Thus spoketh Firat Ozgul <ozgulfirat at gmail.com> 
unto us on Tue, 24 Aug 2010 22:49:28 +0300:

> In Tk documentation, it reads:
> 
> "(...) Tk attempts to guess what Postscript font to use. Tk's guesses
> generally only work for well-known fonts such as Times and Helvetica and
> Courier (...)"
> 
> source: http://www.tcl.tk/man/tcl8.4/TkCmd/canvas.htm (see "-fontmap"
> section)
> 
> So if you would like to be on the safe side, you are only limited to
> Times, Helvetica and Courier...

I have seen this in the description of the fontmap option, but it seems a
little outdated to me, as there is no difference between using fontmap or
not and even obscure fonts as "penguin attack" are found, no matter if
they are written upper or lower case. I also got the
same impression from a comp.lang.tcl search for "fontmap", where tha vast
majority of matches was older than 6 or 7 years; it looks like Tk's
guessing capabilities have improved :)

> 
> In GNU/Linux, as you know, fonts are generally in /usr/share/fonts.
> Therefore you can take this path as the base for your application's font
> folder.

 Not necessarily, for example might people install third-party fonts
into /usr/local or /opt or into their /home directory.

> 
> Also I believe that distributing your own fonts is not a bad idea. If I
> were you, I would just collect all the fonts I need into a folder, and
> distribute that folder with my application. This way, I would always
> know where and what the fonts are... For instance, suppose that you
> collected all your .tff files in a folder named "freefont", and you
> know that there is a .tff file named "FreeSansOblique.ttf" in that
> folder:

The downside is, that people then cannot use their system-wide installed
fonts which they might prefer...

Anyway, I think I will just keep it like it is for now.
If I weren't such a "comic sans ms" aficinado maybe I had never noticed
this and no one complained so far, so I guess people can live with it,
too. It just would have been nice to have a bug free UI.

Thanks again

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

We fight only when there is no other choice.  We prefer the ways of
peaceful contact.
		-- Kirk, "Spectre of the Gun", stardate 4385.3


More information about the Tkinter-discuss mailing list