Topics

Tool bar font size difference 4.3.0 and 5.1.2a #Mac #HowTo #systemfontsize


Geoffrey Dagley
 

This has been the biggest help in using XtrkCad on my Mac!  I could not figure out how to change the font size since I regularly keep my resolution at scale to 1920x1200 on my MacBook Pro.  Thanks so much for this!!!


tynewydd@...
 

Vic,
That is set inside the program itself - the hotBar elements are drawn as graphic objects and the text is a "helvetica" set to size 8pt. The issue is that GTK thinks the screen is 96dpi, but it is actually about twice that. 

You may notice that the hover text (pop-up) is at the same font size as the menus which you fixed. So my simplistic approach is to set the labels off (Options->Display->HotBarLabels) which often gets more objects shown on one screen in the hotbar anyway and hover over them when I want to know what they are... 

This is not perfect, admittedly.  

When we have got to GTK3 in V6 there will be more system options for controlling scale and dpi (and the GTK code is better about handling Hidpi anyway). 

Adam


Vic Dhawan
 

Hi Adam,

Many thanks for the help. This is what I did now and it works for the Menu Bar.

I edited the startup file below (my Xtrkcad install is under /Applications/Trains)

/Applications/Trains/xtrkcad_5.1.2a.app/Contents/MacOS/XtrkCAD

#export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
export GTK2_RC_FILES="$HOME/gtkrc"

Just to keep the rc file in my macos home directory rather than digging down into the install package...

Also did this but not really needed if one just places the gtkrc file in $HOME. This way one can edit either file gtkrc or .gtkrc-2.0. One is visible and the other hidden.

ln -s .gtkrc-2.0 gtkrc
ls -la .gtkrc-2.0 gtkrc
-rw-r--r--  1 zeeb  staff  212 17 Jan 18:09 .gtkrc-2.0
lrwxr-xr-x  1 zeeb  staff   10 18 Jan 14:19 gtkrc -> .gtkrc-2.0

Now, any suggestions for increasing the text size on the Hot Bar?

Regards,
   Vic


tynewydd@...
 

Vic,
No - it is my bad.  I spent the best part of yesterday evening scratching my head as to why it wasn't working. 

The issue is that the package startup script is diverting GTK2 to look at a different location and didn't include this well-known location as well (in other words it is a bug!!).  

Where GTK is looking is inside the program package itself under Contents/Resources/etc/gtk-2.0/ for a file called gtkrc. That will need to be fixed, but for now I have found a way to bypass it.

The bypass I did was as follows - I went into Finder to Applications and Right-clicked on xtrkcad to "Show Package Contents" then I followed Contents/Resources/etc/gtk-2.0 .  I pasted the file in that directory and renamed it as "gtkrc" (note - NOT gtkrc-2.0 and with NO dot at the front). 

Once I did that, the font settings took. The actual content I used was 

--------

style "default-style" 
{
font_name="Sans 12"
}
class "GtkWidget" style "default-style"

gtk-font-name="Sans 12"

----

You can play with the "12" to get a size you like that also fits - as some places fonts go have a formatting issue if it is too large.

Sorry about that - I  

Adam


Vic Dhawan
 

Hi, I followed Adam's instructions and placed a .gtkrc-2.0 file in my macos user home directory and made the following changes but the file appears to be ignored. Am I doing something really stupid? I'm a unix guy so this should be simple...

style "user-font" {
    #font_name = "Lucida Grande 12"
    font_name = "Lucida Grande 18"
}
widget_class "*" style "user-font"

#gtk-font-name="Sans 12"
gtk-font-name="Sans 18"

The file permissions are typical unix so look ok to me too:

-rw-r--r--  1 zeeb  staff    178 17 Jan 17:29 .gtkrc-2.0
-rw-r--r--  1 zeeb  staff     90 18 Jun  2016 .bashrc

Regards,
   Vic


Vic Dhawan
 

I installed 5.1.2a on my Macbook Pro with retina display (Sierra 10.12.6) and found the font sizes a lot smaller compared to 4.3.0 which I also have installed on the same mac.

I noticed this because I was finding it difficult to read the writing on the buttons and the drop down menu items. It's a real strain to read even with reading glasses!

Is there anyway to increase the size to be the same as in 4.3.0?

Regards,
   Vic