Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'coverage.': 0.07; 'indicating': 0.07; 'tkinter': 0.07; 'buttons': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'jan': 0.12; 'windows': 0.15; '(both': 0.16; '(free': 0.16; 'idle,': 0.16; 'optionally': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'renders': 0.16; 'subject:Tkinter': 0.16; 'unicode.': 0.16; 'followed': 0.16; 'wrote:': 0.18; 'app': 0.19; 'seems': 0.21; 'install': 0.23; 'this?': 0.23; 'header:User-Agent:1': 0.23; 'alternate': 0.24; "aren't": 0.24; 'unicode': 0.24; 'certain': 0.27; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'label': 0.30; 'sets': 0.30; 'url:wiki': 0.31; 'dialog': 0.31; 'etc.).': 0.31; 'font': 0.31; 'os,': 0.31; 'url:wikipedia': 0.31; 'know.': 0.32; 'text': 0.33; 'not.': 0.33; 'table': 0.34; "i'd": 0.34; 'could': 0.34; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'url:org': 0.36; 'should': 0.36; 'list': 0.37; 'button': 0.38; 'depends': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'use.': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:173': 0.61; 'back': 0.62; 'email addr:gmail.com': 0.63; 'skip:n 10': 0.64; 'linked': 0.65; 'fonts': 0.84; 'received:fios.verizon.net': 0.84; 'truetype': 0.84; 'subject:available': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Determining whether a glyph is available in Tkinter Date: Mon, 16 Dec 2013 14:41:00 -0500 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387222873 news.xs4all.nl 2830 [2001:888:2000:d::a6]:37739 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62095 On 12/16/2013 12:32 PM, wmcbrine@gmail.com wrote: > I have a Tkinter app that can optionally label some buttons with > certain Unicode glyphs that aren't always available (depending on the > OS, etc.). It depends on the font in use. The best scenario would be to always use the same unicode font. Idle, built on tkinter, has a configuration dialog that gets a list of available fonts and sets the one the user selects. I use Lucida Sans Unicode. It is not very pretty, but it seems to cover much the BMP. AFAIK, it should be available on all Windows from XP on. I do not know what comes with *nix and mac, but from reading https://en.wikipedia.org/wiki/Unicode_font#List_of_Unicode_fonts there seem to be TrueType fonts that you could install with your software: FreeSerif (etc), GNU Unifont, (both GPL), BitstreamCyber (free for non-commercial use). The font table linked above is followed by table indicating something about coverage. Unifont is the champ. > When they aren't available, Tkinter renders them as > "\uNNNN". What I'd like to do is check whether the glyphs are > available, and fall back to my own alternate text for the button if > not. Can I do this? Don't know. See the 'Utility software' section of the page above. > I'd also like to do the same in pygtk. No idea. -- Terry Jan Reedy