Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how does tk find fonts on Ubuntu?

376 views
Skip to first unread message

billp...@gmail.com

unread,
Jun 26, 2011, 4:23:53 AM6/26/11
to
I have the awful feeling I've forgotten something, but, how does Tk
find fonts, specifically on Ubuntu Linux systems? I have installed
some fonts in /usr/share/fonts/truetype. OpenOffice.org is aware of
them, as is xterm, but not Tk.

Robert Heller

unread,
Jun 26, 2011, 6:54:28 AM6/26/11
to

Tk finds the fonts the same way as any other basic X11 program finds
them, via XLoadFont, XQueryFont, XLoadQueryFont, etc. Which in turn
uses the X11 font path: xset fp (set font path) and/or xfs (X11 Font
Server).

man xset
man xfs
man xorg.conf

The fonts also need the X11 metadata setup, if it is not already done
(see 'man mkfontdir').

If all of this IS set up, Tk has its own interface to the X11
Font API (XLoadFont, XQueryFont, XLoadQueryFont, etc.) in the form of
the font command ('man n font' -- look under the section headed '[4] X-font
names'). xlsfonts and xfontsel are also useful utilities.

>

--
Robert Heller -- 978-544-6933 / hel...@deepsoft.com
Deepwoods Software -- http://www.deepsoft.com/
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments



Joe English

unread,
Jun 27, 2011, 1:29:30 PM6/27/11
to
billposer asked:

>> I have the awful feeling I've forgotten something, but, how does Tk
>> find fonts, specifically on Ubuntu Linux systems? I have installed
>> some fonts in /usr/share/fonts/truetype. OpenOffice.org is aware of
>> them, as is xterm, but not Tk.

Robert Heller answered:


>
> Tk finds the fonts the same way as any other basic X11 program finds
> them,

This is true...

> via XLoadFont, XQueryFont, XLoadQueryFont, etc.

... but this no longer is. Basic X11 programs nowadays --
including Tk as of 8.5 -- use client-side fonts and the
fontconfig system, by way of Xft.

Basic information is covered here:

http://www.freedesktop.org/software/fontconfig/fontconfig-user.html

Your desktop environment and/or OS vendor may have additional
layers on top of fontconfig (Debian f'rinstance uses something
called "defoma"; don't know about other systems).

--Joe English

0 new messages