Determining whether a glyph is available in Tkinter

wmcbrine at gmail.com wmcbrine at gmail.com
Mon Dec 16 18:59:55 EST 2013


I'm not going to control the font. This is for a program that's distributed to the general public, for use on a wide variety of systems. But what I do in the current version is to use the ASCII label strings by default, and have a command-line option to select the "graphical" (non-ASCII Unicode) labels. What I want is to make the graphical labels the default, and have the program detect, at runtime, whether any of the glyphs used in the fancy labels would render as "\uNNNN" in whatever the default font for the buttons is, and automatically revert to the ASCII labels in that case.

I'm assuming this is possible, because Tkinter itself seems to know which glyphs are unavailable, or they'd probably be showing up as those boxed number characters or question marks instead of "\uNNNN".



More information about the Python-list mailing list