Change ledger font

Geert Janssens geert.gnucash at kobaltwit.be
Thu Sep 25 09:00:21 EDT 2014


On Wednesday 24 September 2014 07:12:07 AC wrote:
> On 2014-09-24 00:44, Geert Janssens wrote:
> > On Tuesday 23 September 2014 13:39:55 AC wrote:
> >> On 2014-09-23 09:18, Geert Janssens wrote:
> >>> The only reasons I can imagine for not finding this in your home
> >>> directory would be either:
> >>> 1. either your folder preferences hide this file for you
> >>> 2. or you have altered the value of the HOME environment variable
> >>> to
> >>> point somewhere else. Is such a line in
> >>> \program files (x86)\gnucash\etc\gnucash\environment ?
> >> 
> >> Files are not hidden from view in the explorer windows (I always
> >> turn
> >> that off on any machine) and that setting does not affect the find
> >> utility under Cygwin, a simple 'ls' can still see those files.
> > 
> > Ah, this is the first time you mention Cygwin. Are you running
> > gnucash and the theme selection tool from within cygwin as well ?
> > 
> > Where is cygwin installed ?
> > 
> >> I have also not altered the environment variables, HOME is still
> >> C:\users\
> > 
> > Ok
> > 
> >> There are no edited entries in the environment file:
> > Ok
> > 
> >> Searching with multiple utilities does not reveal any .gtkrc-2.0
> >> files anywhere:
> >> 
> >> $ find /cygdrive/c -name *.gtkrc* 2>/dev/null
> >> 
> >> $
> > 
> > I have no explanation for that currently...
> > 
> >> (I redirected stderr to trim errors caused by accessing some core
> >> Windows files)
> >> 
> >> Searching for plain gtkrc:
> >> 
> >> $ find /cygdrive/c -name *gtkrc* 2>/dev/null
> >> /cygdrive/c/Program Files
> >> (x86)/GNU/GnuPG/share/themes/Default/gtk-2.0-key/gtkrc
> >> /cygdrive/c/Program Files
> >> (x86)/GNU/GnuPG/share/themes/Emacs/gtk-2.0-key/gtkrc
> >> /cygdrive/c/Program Files
> >> (x86)/GNU/GnuPG/share/themes/MS-Windows/gtk-2.0/gtkrc
> >> 
> >> [ trimming additional share/themes entries]
> >> 
> >> /cygdrive/c/Users/agcarver/AppData/Local/VirtualStore/Program Files
> >> (x86)/gnucash/etc/gtk-2.0/gtkrc
> >> 
> >> 
> >> Opening that last file:
> >> 
> >> # Auto-written by gtk2_prefs. Do not edit.
> >> 
> >> gtk-theme-name = "Bluecurve-Slate"
> >> style "user-font"
> >> {
> >> 
> >> 	font_name="Arial 10"
> >> 
> >> }
> >> widget_class "*" style "user-font"
> >> 
> >> So it looks like this is the mystery file which does not match the
> > 
> >> documentation in the slightest.  The path is entirely wrong:
> > That is an interesting observation.
> > 
> > However I have another theory about the file you found, but I can't
> > be sure until we test.
> > 
> > The way to be sure this file is really written by the theme tool is
> > this:
> > - make a copy of the file so you can revert back to it if needed
> > - run the theme tool and choose another theme than is currently in
> > the gtkrc file
> > [Note: on my test system the theme tool asks for confirmation to
> > overwrite my previous file, which still is
> > c:\Documents and settings\<user>\.gtkrc-2.0
> > as explained in the documentation]
> > - reopen the gtkrc file you found and check if the theme has been
> > changed.
> > 
> > What is the result now ?
> 
> No, I'm not running it within Cygwin, I'm only mentioning Cygwin as
> one of the tools I was using to help track down the file.  GnuCash is
> installed as a Windows binary.
> 
> 
> 
> This is the file being written by the theme tool.  The theme name
> changes if I use the theme selector to set another theme.  The dialog
> box says that the file "c:\Documents and settings\<user>\.gtkrc-2.0"
> will be changed however the file that does get written is:
> 
> C:\Users\<user>\AppData\Local\VirtualStore\Program Files
> (x86)\gnucash\etc\gtk-2.0\gtkrc
> 
> 
> This is ok, now that the mystery is solved for my particular system I
> can edit this file to adjust my theme.  I don't understand why it
> writes there but that's where it is deciding to write.
> 
Very interesting. This is new for me as well. And it made me dig a bit 
deeper. I think I have found the difference: did you enable the option 
"Apply for all users ?"

That would cause the theme tool to change the file located in 
c:\Program Files (x86)\gnucash\etc\gtk-2.0\gtkrc
However on Windows Vista and more recent this triggers a special 
mechanism if you're not running this as an administrator. Instead of 
changing that file directly Windows will change a cloned file in your 
local preferences area:
c:\Users\agcarver\AppData\Local\VirtualStore\Program Files 
(x86)\gnucash\etc\gtk-2.0\gtkrc

Which is the file you have found and are now editing manually.

A few more questions to get to the bottom of this:
1. If you open the file c:\Program Files (x86)\gnucash\etc\gtk-2.0\gtkrc
directly, does it also reflect the changes ? I am asking this just to 
learn how Windows 7 represents this to the user (I only have access to 
Windows XP)

2. What happens if you disable the option "Apply for all users ?" and 
then rerun the theme tool ?

> Is there a list of widgets in the source tarball that I can use to
> identify the appropriate names for making style adjustments?  I can't
> seem to figure out the name to use for things like the ledger header
> font color.
For your convenience, I have improved the relevant FAQ entry:
http://wiki.gnucash.org/wiki/FAQ#Q:_How_do_I_change_the_register_colors.3F

Is that information sufficient for you to change the colors ?

Let me repeat that changing the register colors will not work in any 
version of gnucash 2.6.3 and older. If you want to test your changes you 
can try a recent nightly build [1] or wait for gnucash 2.6.4 to be 
released (which will be very soon now).

Regards,

Geert

[1] http://code.gnucash.org/builds/win32/maint/


More information about the gnucash-user mailing list