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

How does Tk know which fonts are available?

55 views
Skip to first unread message

Alan Grunwald

unread,
Sep 19, 2022, 11:18:32 AM9/19/22
to
I've recently upgraded from ActiveTcl-8.6.9 to tcl/tk 8.6.12. I notice
that there are far fewer fonts available with my new configuration.
xlsfonts lists loads of fonts that aren't shown by wish% font families.

Apparently I have made a mistake when building Tk, which I did with

configure --prefix /opt/tcl8.6.12

Please can you help me to correct my configuration?

Many thanks,
Alan

Ralf Fassel

unread,
Sep 19, 2022, 11:31:40 AM9/19/22
to
* Alan Grunwald <nospam....@gmail.com>
Might be related to the

--enable-xft use freetype/fontconfig/xft (default: on)

configure option.

R'

Alan Grunwald

unread,
Sep 20, 2022, 5:49:49 AM9/20/22
to
That sounds quite feasible; I've rebuilt Tk via

configure --prefix /opt/tcl8.6.12 --disable-xft

but this has had no effect - I still see the same limited list of fonts
with [font families]

Rich

unread,
Sep 20, 2022, 6:20:56 AM9/20/22
to
Alan Grunwald <nospam....@gmail.com> wrote:
> On 19/09/2022 16:31, Ralf Fassel wrote:
>> * Alan Grunwald <nospam....@gmail.com>
>> | I've recently upgraded from ActiveTcl-8.6.9 to tcl/tk 8.6.12. I notice
>> | that there are far fewer fonts available with my new
>> | configuration. xlsfonts lists loads of fonts that aren't shown by
>> | wish% font families.
>>>
>> | Apparently I have made a mistake when building Tk, which I did with
>>>
>> | configure --prefix /opt/tcl8.6.12
>>>
>> | Please can you help me to correct my configuration?
>>
>> Might be related to the
>>
>> --enable-xft use freetype/fontconfig/xft (default: on)
>>
>> configure option.
>>
>> R'
> That sounds quite feasible; I've rebuilt Tk via
>
> configure --prefix /opt/tcl8.6.12 --disable-xft
^^^^^^^
If this is how you built it, you *disabled* xft, which will severely
limit the number of available fonts (as pretty much all fonts except
for the old bitmapped ones are provided by the xft library anymore)

> but this has had no effect - I still see the same limited list of fonts
> with [font families]

If you in fact disabled xft, then a limited set of fonts would be the
expected outcome.

Christian Gollwitzer

unread,
Sep 20, 2022, 6:40:21 AM9/20/22
to
Am 20.09.22 um 12:20 schrieb Rich:
> Alan Grunwald <nospam....@gmail.com> wrote:

>> That sounds quite feasible; I've rebuilt Tk via
>>
>> configure --prefix /opt/tcl8.6.12 --disable-xft
> ^^^^^^^
> If this is how you built it, you *disabled* xft, which will severely
> limit the number of available fonts

Also, keep in mind that you might need some extra headers for building
against xft.

Christian

Schelte

unread,
Sep 20, 2022, 6:44:36 AM9/20/22
to
On 20/09/2022 12:20, Rich wrote:
> If you in fact disabled xft, then a limited set of fonts would be the
> expected outcome.

Also check the output of `configure`. You should see:

checking whether to use xft... yes

If it says 'no', even when you didn't disable xft, you may be missing
the necessary development package. Add it with `zypper in libXft-devel`,
or whatever incantation your package management system needs.


Schelte.


Alan Grunwald

unread,
Sep 20, 2022, 7:43:33 AM9/20/22
to
Thanks gents.

I was originally configuring with

configure --prefix /opt/tcl8.6.12

which *should* have had xft enabled. I tried

configure --prefix /opt/tcl8.6.12 --disable-xft

to see whether it had any effect.

I've now reverted to the original command line -

configure --prefix /opt/tcl8.6.12

and checked that the output does indeed include

checking whether to use xft... yes

As far as I can tell I have the development package -

alan@kenneth:~$ sudo apt install libxft-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxft-dev is already the newest version (2.3.3-0ubuntu1).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

but I can't find any headers with likely looking names. As far as I can see,

make

has completed without errors.

I also see that the compilation flags -DHAVE_LIBXFT=1 and -DHAVE_XFT=1
are both present. However, I can't find any use of HAVE_LIBXFT in the
sources, and the only use of HAVE_XFT I can find is in tkInt.h, which
includes the line

MODULE_SCOPE void TkUnixSetXftClipRegion(TkRegion clipRegion);

when it is defined; I can't find any reference to TkUnixSetXftClipRegion
anywhere.

(I've got three versions of Tcl/Tk on this system - ActiveTcl-8.6
(8.6.9), the default from Ubuntu (8.6.10) and my homebrew 8.6.12. The
8.6.9 and 8.6.10 versions seem to have a full complement of fonts, it's
just my own poor attempt that has problems.)

Still confused!
Alan

Alan Grunwald

unread,
Sep 20, 2022, 9:40:07 AM9/20/22
to
I hate it when this happens...

o I found tk.pc, which describes itself as the Tk pkg-config source file
o The Active-Tcl version suggests that wish was linked with -LXrender
o I tried to configure with

configure --prefix=/opt/tcl8.6.12 --with-XRender

it seemed to make no difference.

I then discovered that as well as the expected /opt/tcl8.6.12, I also
had a directory named /opt/8.6.12. Speculating that I'd mistyped the
configure argument (as --prefix=/opt/8.6.12) I retried

configure --prefix=/opt/tcl8.6.12

and [font families] returns loads of fonts - at least comparable with
the number returned by the Active-Tcl and default versions. Most
importantly, when I run tkcon and "the myriad applications I've
developed over the years", the fonts I am accustomed to are used for
menus, dialogs and text widgets.

So, thanks for reading and responding to my ravings; your patience has
allowed me to sort out my problem.

Alan
0 new messages