Change ledger font

AC gnucash at acarver.net
Thu Sep 25 12:01:09 EDT 2014


On 2014-09-25 06:00, Geert Janssens wrote:
> 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).

Yes, I did use the "Apply to all users" feature so that would explain
the difference.  Leaving that unselected does indeed generate the
original .gtkrc-2.0 file that you initially suggested and that I could
not find.

I do want to report that I have actually, successfully, changed the
register colors using these files using 2.6.3.  I'm not sure what bug is
at issue but it did change for me.  I chose 'System theme colors' in the
preferences and then edited the above gtkrc file (the system-wide
version, not the user specific one) and the ledger changed color with no
problems.  I was not able to change the text colors only because I don't
know how to address that part but the row backgrounds did change from
green/tan to whatever I chose (currently gold/dark gold just for fun).

Since color changes is working I wanted to get the appropriate widget
names that would let me change the font colors of the lines.  Background
color is working well, just need the font color so I can change it to
white on dark row backgrounds.



More information about the gnucash-user mailing list