[GNC] Font problem

Adrien Monteleone adrien.monteleone at lusfiber.net
Wed Oct 16 15:22:30 EDT 2019


> I don't know about any other GTK3 program. I checked 'https://en.wikipedia.org/wiki/GTK' but I don't recognize anything.

If you don’t knowingly have other GTK3 programs installed, then you can ignore this question.

>>>> Finally, try different fonts, including the default, and see what the printed result looks like.
>>> 
>>> I tried different fonts in ~/Library/Application\ Support/Gnucash/config/gtk-3.0/gtk.css
>>> but it seems to have no effect on the 'Print Invoice' button result window, or on error messages.
>> 
>> So any font you choose mangles those three letters? Do other fonts mangle other letters?
> 
> No, any font I specify in ~/Library/Application\ Support/Gnucash/config/gtk-3.0/gtk.css is OK.

Ah, I was misreading, sorry. I also was misunderstanding the original post. The `*` selector should mean the font rule will apply to all elements in the app’s UI. (which would include error messages in dialogs) But the printed reports have defined stylesheets that provide their own font declarations. Check to see what those are set for and which stylesheet is being used, try other fonts and see if the problem persists.

Also, while technically it should work either way, the wiki page on Configuration Locations notes TWO config locations: https://wiki.gnucash.org/wiki/Configuration_Locations#GNC_CONFIG_HOME

GNC_CONFIG_HOME for MacOS is:

HOME/Library/Application Support/GnuCash

GTK_CONFIG_HOME is:

HOME/Library/Application Support/GnuCash/config/gtk-3.0

Notice that one is 2 levels down. I have my custom CSS file in the first one and it works fine. I’ve never tried putting it in the gtk-3.0 directory.


The wiki GTK3 page recommends using the first one as well: https://wiki.gnucash.org/wiki/GTK3#Typefaces


> 
> 
>> I’m thinking this might well be a GTK issue. Do you still have this problem after uninstalling GTK3 via MacPorts?
> 
> Same with and without.

So that is eliminated, I’m still leaning towards a corrupt font file.

1. Open FontBook.app
2. Select ‘All Fonts’ in the sidebar
3. Click one font in the list, then CMD-A to ’select-all’
4. File > Validate Fonts

This will check all of your font files for errors or problems and report which ones are bad/problematic. You can then delete or disable those fonts. If you find any and delete/disable them, then restart GnuCash and see if the problem persists.

> 
> 
>> What IS the default font on a mac, so that I can check it for errors?
>> 
>> Unfortunately, Apple hides it from us. It is ’San Francisco’ by name, but you can’t see it in FontBook and it isn’t selectable in apps. (best I can tell)
> 
> I have 'SFNS Display' in Font Book, and it doesn't look like the system font.

That is a different font entirely.

I did find this interesting tidbit with relevance to CSS: https://stackoverflow.com/questions/32660748/how-to-use-apples-new-san-francisco-font-on-a-webpage

I don’t know if GTK apps will work with it, but maybe try -apple-system in your font stack declaration. Note, that by default, if GnuCash is using the default system display font, you likely won’t see any change.


> 
> 
>> But I think the default stylesheets in GnuCash use Arial. Maybe give that a try. Also, simply commenting out your font declaration in the CSS file will restore the app’s default for the UI.
> 
> The font use for 'print invoice, error messages, etc' is not affected by the gtk.css, where is it defined?

As for the printable reports - fonts are defined in stylesheets within GnuCash., not in the config directories or a custom app-wide CSS file. (as noted above) You can create your own or edit existing ones. (including the default stylesheet)

See Edit > Style Sheets for editing them, and Options > General for stylesheet assignment for that report.

I’m not clear what you mean by ‘error messages, etc.’ Dialogs are controlled by the UI and that *should* be affected by a `*` CSS selector. (though GTK3 CSS doesn’t always play nice like web CSS)

Troubleshooting font issues can be quite a rabbit hole at times.

Regards,
Adrien


More information about the gnucash-user mailing list