Beispiel #1
0
/****************************************************************************
  Update a font option which is not attached to a widget.
****************************************************************************/
void gui_update_font_full(const char *font_name, const char *font_value,
                          GtkStyle **pstyle)
{
  GtkSettings *settings;
  GdkScreen *screen;
  GtkStyle *style;
  char buf[64];

  gui_update_font(font_name, font_value);

  screen = gdk_screen_get_default();
  settings = gtk_settings_get_for_screen(screen);

  fc_snprintf(buf, sizeof(buf), "Freeciv*.%s", font_name);
  style = gtk_rc_get_style_by_paths(settings, buf, NULL, G_TYPE_NONE);

  if (style) {
    g_object_ref(style);
  } else {
    style = gtk_style_new();
  }

  if (*pstyle) {
    g_object_unref(*pstyle);
  }
  *pstyle = style;
}
Beispiel #2
0
/****************************************************************************
  Update a font option which is not attached to a widget.
****************************************************************************/
void gui_update_font_full(const char *font_name, const char *font_value,
                          PangoFontDescription **font_desc)
{
  PangoFontDescription *f_desc;

  gui_update_font(font_name, font_value);

  f_desc = pango_font_description_from_string(font_value);
  pango_font_description_free(*font_desc);

  *font_desc = f_desc;
}