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

Setting Tk default font sizes system wide

538 views
Skip to first unread message

Richard Owlett

unread,
Sep 28, 2018, 11:46:14 AM9/28/18
to
I've just installed 'filerunner'
[https://sourceforge.net/projects/filerunner/] whose configuration
utility refers to standard Tk fonts (TkDefaultFont, TkTextFont,
TkFixedFont, TkMenuFont, etc).

I have found https://www.tcl.tk/man/tcl8.5/TkCmd/font.htm#M31 which only
states:
> The following named fonts are supported on all systems, and default to
> values that match appropriate system defaults.

I'm using the MATE Desktop on Debian 9.
I went to System->Preferences->Look and feel->Appearance to experiment
with font sizes.

I saw no difference in the appearance of filerunner.
Is there a tool to display/set Tk font sizes?

Brad Lanam

unread,
Sep 28, 2018, 4:09:31 PM9/28/18
to
There is 'tk scaling'. This will allow you to adjust the scaling
factor of fonts and widgets to match the DPI of your screen. I believe
it can be put in your .wishrc (I've never used it that way, so I don't
have any knowledge there).

See: https://wiki.tcl-lang.org/8484

I'm just trying to think if there's any way affect some external Tcl program's
font sizing. If it is a standard Tcl program, I suppose you could try:

#!/usr/bin/tclsh

package require Tk

font configure TkDefaultFont -size 12p
source someotherprogram

I have no idea if that would work out well or at all.

Richard Owlett

unread,
Sep 29, 2018, 8:48:49 AM9/29/18
to
On 09/28/2018 03:09 PM, Brad Lanam wrote:
> On Friday, September 28, 2018 at 8:46:14 AM UTC-7, Richard Owlett wrote:
>> I've just installed 'filerunner'
>> [https://sourceforge.net/projects/filerunner/] whose configuration
>> utility refers to standard Tk fonts (TkDefaultFont, TkTextFont,
>> TkFixedFont, TkMenuFont, etc).
>>
>> I have found https://www.tcl.tk/man/tcl8.5/TkCmd/font.htm#M31 which only
>> states:
>>> The following named fonts are supported on all systems, and default to
>>> values that match appropriate system defaults.
>>
>> I'm using the MATE Desktop on Debian 9.
>> I went to System->Preferences->Look and feel->Appearance to experiment
>> with font sizes.
>>
>> I saw no difference in the appearance of filerunner.
>> Is there a tool to display/set Tk font sizes?
>
> There is 'tk scaling'. This will allow you to adjust the scaling
> factor of fonts and widgets to match the DPI of your screen. I believe
> it can be put in your .wishrc (I've never used it that way, so I don't
> have any knowledge there).
>
> See: https://wiki.tcl-lang.org/8484

That didn't lead me anywhere.
However I doubt that is related strongly to what I see as the program
responds as expected toggling the '^' in the top right of screen.

>
> I'm just trying to think if there's any way affect some external Tcl program's
> font sizing. If it is a standard Tcl program, I suppose you could try:
>
> #!/usr/bin/tclsh
>
> package require Tk
>
> font configure TkDefaultFont -size 12p
> source someotherprogram
>
> I have no idea if that would work out well or at all.
>

It led to a resolution of symptoms if not an underlying problem(bug???).
There may be an environmental dependency of some sort.
[I'm using Tcl/Tk 8.6 on Debian Stretch with MATE Desktop]

I followed that as a pattern setting the size of all Tk...Font.
It worked in an *UNEXPECTED* manner - filerunner's font configuration
window now works. It is unclear if it is a MATE, Tk, or filerunner problem.

Now that things are legible, it looks as though filerunner is the
appropriate tool for me.

Thanks



Brad Lanam

unread,
Sep 29, 2018, 11:50:24 AM9/29/18
to
On Saturday, September 29, 2018 at 5:48:49 AM UTC-7, Richard Owlett wrote:
> On 09/28/2018 03:09 PM, Brad Lanam wrote:
> > On Friday, September 28, 2018 at 8:46:14 AM UTC-7, Richard Owlett wrote:
> >> I've just installed 'filerunner'
> >> [https://sourceforge.net/projects/filerunner/] whose configuration
> >> utility refers to standard Tk fonts (TkDefaultFont, TkTextFont,
> >> TkFixedFont, TkMenuFont, etc).
> >>
> >> I have found https://www.tcl.tk/man/tcl8.5/TkCmd/font.htm#M31 which only
> >> states:
> >>> The following named fonts are supported on all systems, and default to
> >>> values that match appropriate system defaults.
> >>
> >> I'm using the MATE Desktop on Debian 9.
> >> I went to System->Preferences->Look and feel->Appearance to experiment
> >> with font sizes.
> >>
> >> I saw no difference in the appearance of filerunner.
> >> Is there a tool to display/set Tk font sizes?
> >
> > There is 'tk scaling'. This will allow you to adjust the scaling
> > factor of fonts and widgets to match the DPI of your screen. I believe
> > it can be put in your .wishrc (I've never used it that way, so I don't
> > have any knowledge there).
> >
> > See: https://wiki.tcl-lang.org/8484
>
> That didn't lead me anywhere.
> However I doubt that is related strongly to what I see as the program
> responds as expected toggling the '^' in the top right of screen.

I just ran an 'strace' and it doesn't appear that 'wish' tries to locate
a '.wishrc' file at all. Must be broken.

> >
> > I'm just trying to think if there's any way affect some external Tcl program's
> > font sizing. If it is a standard Tcl program, I suppose you could try:
> >
> > #!/usr/bin/tclsh
> >
> > package require Tk
> >
> > font configure TkDefaultFont -size 12p
> > source someotherprogram
> >
> > I have no idea if that would work out well or at all.
> >
>
> It led to a resolution of symptoms if not an underlying problem(bug???).
> There may be an environmental dependency of some sort.
> [I'm using Tcl/Tk 8.6 on Debian Stretch with MATE Desktop]
>
> I followed that as a pattern setting the size of all Tk...Font.
> It worked in an *UNEXPECTED* manner - filerunner's font configuration
> window now works. It is unclear if it is a MATE, Tk, or filerunner problem.
>
> Now that things are legible, it looks as though filerunner is the
> appropriate tool for me.

I didn't have any trouble with fr's font configuration screen.
I'm on MX Linux running XFCE so the environment's not quite the same.

I did have trouble getting filerunner to run at all, as it removes
packages from TCLLIBPATH.
Had to change the 'if {1}' around line 5182 to 'if {0}'.

Richard Owlett

unread,
Sep 29, 2018, 1:10:44 PM9/29/18
to
Using Debian Stretch default install, there's no '.wishrc'.
My wander through links on wiki suggests it is less commonly used today.


>>>
>>> I'm just trying to think if there's any way affect some external Tcl program's
>>> font sizing. If it is a standard Tcl program, I suppose you could try:
>>>
>>> #!/usr/bin/tclsh
>>>
>>> package require Tk
>>>
>>> font configure TkDefaultFont -size 12p
>>> source someotherprogram
>>>
>>> I have no idea if that would work out well or at all.
>>>
>>
>> It led to a resolution of symptoms if not an underlying problem(bug???).
>> There may be an environmental dependency of some sort.
>> [I'm using Tcl/Tk 8.6 on Debian Stretch with MATE Desktop]
>>
>> I followed that as a pattern setting the size of all Tk...Font.
>> It worked in an *UNEXPECTED* manner - filerunner's font configuration
>> window now works. It is unclear if it is a MATE, Tk, or filerunner problem.
>>
>> Now that things are legible, it looks as though filerunner is the
>> appropriate tool for me.
>
> I didn't have any trouble with fr's font configuration screen.
> I'm on MX Linux running XFCE so the environment's not quite the same.
>
> I did have trouble getting filerunner to run at all, as it removes
> packages from TCLLIBPATH.
> Had to change the 'if {1}' around line 5182 to 'if {0}'.
>

No apparent difference for me.

Brad Lanam

unread,
Sep 29, 2018, 1:26:26 PM9/29/18
to
On Saturday, September 29, 2018 at 10:10:44 AM UTC-7, Richard Owlett wrote:
> On 09/29/2018 10:50 AM, Brad Lanam wrote:
> > I just ran an 'strace' and it doesn't appear that 'wish' tries to locate
> > a '.wishrc' file at all. Must be broken.
> >
>
> Using Debian Stretch default install, there's no '.wishrc'.
> My wander through links on wiki suggests it is less commonly used today.

Not surprising considering it's inconsistency.

It seems singularly useless.

Rather unfortunate, as putting a 'tk scaling <scale>' in
a .wishrc would be useful as the default 96 DPI (38 dpcm)
probably is not the most common size.

- /home/bll/local/bin/wish
.wishrc loaded.
- #!/home/bll/local/bin/wish
No .wishrc loaded.
- #!/usr/bin/env wish
No .wishrc loaded.
- #!/home/bll/local/bin/tclsh
package require Tk
No .wishrc loaded.

Rich

unread,
Sep 29, 2018, 2:36:07 PM9/29/18
to
Slackware 14.1 - Tcl 8.6.1

.wishrc would be loaded, if I had a .wishrc:

open("/home/__________/.wishrc", O_RDONLY) = -1 ENOENT (No such file or directory)
0 new messages