• How does Tk know which fonts are available?

    From Alan Grunwald@21:1/5 to All on Mon Sep 19 16:18:27 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Mon Sep 19 17:31:35 2022
    * Alan Grunwald <nospam.nurdglaw@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'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Grunwald@21:1/5 to Ralf Fassel on Tue Sep 20 10:49:29 2022
    On 19/09/2022 16:31, Ralf Fassel wrote:
    * Alan Grunwald <nospam.nurdglaw@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

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Tue Sep 20 12:40:17 2022
    Am 20.09.22 um 12:20 schrieb Rich:
    Alan Grunwald <nospam.nurdglaw@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Alan Grunwald on Tue Sep 20 10:20:52 2022
    Alan Grunwald <nospam.nurdglaw@gmail.com> wrote:
    On 19/09/2022 16:31, Ralf Fassel wrote:
    * Alan Grunwald <nospam.nurdglaw@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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Schelte@21:1/5 to Rich on Tue Sep 20 12:44:30 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Grunwald@21:1/5 to Schelte on Tue Sep 20 12:43:28 2022
    On 20/09/2022 11:44, Schelte wrote:
    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.


    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Grunwald@21:1/5 to Alan Grunwald on Tue Sep 20 14:40:01 2022
    On 20/09/2022 12:43, Alan Grunwald wrote:
    On 20/09/2022 11:44, Schelte wrote:
    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.


    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

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)