Re: gtk3 (GtkTextView) and MacOS



On Wed, 25 Feb 2015, Roger Davis wrote:

Thanks, Jim, your hint on setting XDG_CONFIG_HOME led me to a bunch of other useful info on the web that I have been slogging through all morning now. I have had some success but am still far from the finish line.

On my Mac, if I set XDG_CONFIG_HOME to /opt/local/share/themes/HighContrast, which is where MacPorts dumped the HighContrast theme, and which contains a gtk-3.0 subdirectory with the files gtk.css, gtk.gresource and settings.ini, my app successfully loads the HighContrast theme, although I still have the same font problems within my GtkTextView windows.

Similarly, I can make my own settings.ini file in ~/gtksettings/gtk-3.0, set XDG_CONFIG_HOME to ~/gtksettings, and my app processes that file, but again with the same font issues. That file contains a line of the form

  gtk-font-name = fontname fontsize

e.g.,

  gtk-font-name = Sans 10

and I can tweak the fontsize value and successfully get the altered font size in my app. However, absolutely nothing that I do to the fontname results in the use of a different font. In fact,

  gtk-font-name = FontConfusion 10

still loads exactly the same font!

So, I am now convinced this is some kind of font installation or configuration problem. I am guessing that my MacOS gtk3 can't find any fonts whatsoever except for this exceptionally unintelligent fallback font it seems to be using. Does anyone know where gtk3 is looking for its fonts?

I can't claim to offer anything definitive but the hints are: fontconfig and fc-cache. Fontconfig should be responsible for providing font information to gtk + pango, and fc-cache is the program that establishes the cache on which fontconfig draws. You might try doing "sudo fc-cache" and see if that makes any difference to subsequent runs of your gtk program on OS X.

--
Allin Cottrell
Department of Economics
Wake Forest University


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]