• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pango_font_description_to_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pango_font_description_to_string函数的典型用法代码示例。如果您正苦于以下问题:C++ pango_font_description_to_string函数的具体用法?C++ pango_font_description_to_string怎么用?C++ pango_font_description_to_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pango_font_description_to_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: apply_values

static void
apply_values (void)
{
	gchar *utf;
	grg_ctx_set_crypt_algo (gctx, tmp_pref_crypto);
	grg_ctx_set_hash_algo (gctx, tmp_pref_hash);
	grg_ctx_set_comp_algo (gctx, tmp_pref_comp);
	grg_ctx_set_comp_ratio (gctx, tmp_pref_ratio);
	g_free (grg_pref_file);
	grg_pref_file =
		g_strdup (gtk_entry_get_text (GTK_ENTRY (file_entry)));
	utf = g_filename_from_utf8 (grg_pref_file, -1, NULL, NULL, NULL);
	if (!g_file_test (utf, G_FILE_TEST_IS_REGULAR))
	{
		g_free (grg_pref_file);
		grg_pref_file = NULL;
		gtk_entry_set_text (GTK_ENTRY (file_entry), "");
	}
	g_free (utf);

	set_pref_font_string (pango_font_description_to_string
			      (pango_context_get_font_description
			       (gtk_widget_get_pango_context
				(gtk_bin_get_child (GTK_BIN (but_font))))));
	set_editor_font (grg_prefs_editor_font);

	update_saveable (GRG_SAVE_ACTIVE);
	grg_save_prefs ();
}
开发者ID:BackupTheBerlios,项目名称:gringotts-svn,代码行数:29,代码来源:grg_prefs.c


示例2: g_assert

Glib::ustring font_factory::ConstructFontSpecification(PangoFontDescription *font)
{
    Glib::ustring pangoString;

    g_assert(font);

    if (font) {
        // Once the format for the font specification is decided, it must be
        // kept.. if it is absolutely necessary to change it, the attribute
        // it is written to needs to have a new version so the legacy files
        // can be read.

        PangoFontDescription *copy = pango_font_description_copy(font);

        pango_font_description_unset_fields (copy, PANGO_FONT_MASK_SIZE);
        char * copyAsString = pango_font_description_to_string(copy);
        pangoString = copyAsString;
        g_free(copyAsString);
        copyAsString = 0;

        pango_font_description_free(copy);

    }

    return pangoString;
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:26,代码来源:FontFactory.cpp


示例3: tweet_window_style_set

static void
tweet_window_style_set (GtkWidget *widget,
                        GtkStyle  *old_style)
{
  TweetWindowPrivate *priv = TWEET_WINDOW (widget)->priv;
  ClutterColor active_color = { 0, };
  ClutterColor text_color = { 0, };
  ClutterColor bg_color = { 0, };
  gchar *font_name;

  tweet_widget_get_base_color (widget, GTK_STATE_SELECTED, &active_color);
  tweet_widget_get_text_color (widget, GTK_STATE_NORMAL, &text_color);
  tweet_widget_get_bg_color (widget, GTK_STATE_NORMAL, &bg_color);

  font_name = pango_font_description_to_string (widget->style->font_desc);

  tidy_stylable_set (TIDY_STYLABLE (priv->scroll),
                     "active-color", &active_color,
                     "bg-color", &bg_color,
                     NULL);
  tidy_stylable_set (TIDY_STYLABLE (priv->status_view),
                     "active-color", &active_color,
                     "bg-color", &bg_color,
                     "text-color", &text_color,
                     "font-name", font_name,
                     NULL);

  g_free (font_name);
}
开发者ID:patoh,项目名称:tweet,代码行数:29,代码来源:tweet-window.c


示例4: gimp_font_util_pango_font_description_to_string

gchar *
gimp_font_util_pango_font_description_to_string (const PangoFontDescription *desc)
{
  gchar       *name;
  size_t       wordlen;
  const gchar *p;

  g_return_val_if_fail (desc != NULL, NULL);

  name = pango_font_description_to_string (desc);

  p = getword (name, name + strlen (name), &wordlen);

  if (wordlen)
    {
      gchar   *end;
      gdouble  size;

      size = g_ascii_strtod (p, &end);

      if (end - p == wordlen)
        {
          gchar *new_name;

          new_name = g_strconcat (name, ",", NULL);
          g_free (name);

          name = new_name;
        }
    }

  return name;
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:33,代码来源:gimpfont-utils.c


示例5: gimp_font_list_add_font

static void
gimp_font_list_add_font (GimpFontList         *list,
                         PangoContext         *context,
                         PangoFontDescription *desc)
{
  gchar *name;

  if (! desc)
    return;

  name = pango_font_description_to_string (desc);

  if (g_utf8_validate (name, -1, NULL))
    {
      GimpFont *font;

      font = g_object_new (GIMP_TYPE_FONT,
                           "name",          name,
                           "pango-context", context,
                           NULL);

      gimp_container_add (GIMP_CONTAINER (list), GIMP_OBJECT (font));
      g_object_unref (font);
    }

  g_free (name);
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:27,代码来源:gimpfontlist.c


示例6: st_entry_style_changed

static void
st_entry_style_changed (StWidget *self)
{
  StEntryPrivate *priv = ST_ENTRY_PRIV (self);
  StThemeNode *theme_node;
  ClutterColor color;
  const PangoFontDescription *font;
  gchar *font_string;
  gdouble size;

  theme_node = st_widget_get_theme_node (self);
 
  st_theme_node_get_foreground_color (theme_node, &color);
  clutter_text_set_color (CLUTTER_TEXT (priv->entry), &color);

  if (st_theme_node_lookup_length (theme_node, "caret-size", TRUE, &size))
    clutter_text_set_cursor_size (CLUTTER_TEXT (priv->entry), (int)(.5 + size));

  if (st_theme_node_lookup_color (theme_node, "caret-color", TRUE, &color))
    clutter_text_set_cursor_color (CLUTTER_TEXT (priv->entry), &color);

  if (st_theme_node_lookup_color (theme_node, "selection-background-color", TRUE, &color))
    clutter_text_set_selection_color (CLUTTER_TEXT (priv->entry), &color);

  if (st_theme_node_lookup_color (theme_node, "selected-color", TRUE, &color))
    clutter_text_set_selected_text_color (CLUTTER_TEXT (priv->entry), &color);

  font = st_theme_node_get_font (theme_node);
  font_string = pango_font_description_to_string (font);
  clutter_text_set_font_name (CLUTTER_TEXT (priv->entry), font_string);
  g_free (font_string);

  ST_WIDGET_CLASS (st_entry_parent_class)->style_changed (self);
}
开发者ID:3n4rch3,项目名称:Cinnamon,代码行数:34,代码来源:st-entry.c


示例7: gw_settingswindow_sync_global_document_font_cb

G_MODULE_EXPORT void 
gw_settingswindow_sync_global_document_font_cb (GSettings *settings, gchar *KEY, gpointer data)
{
    //Declarations
    GwSettingsWindow *window;
    GwSettingsWindowPrivate *priv;
    GwApplication *application;
    LwPreferences *preferences;
    gchar font[50];
    gchar *font2;
    gchar *text;
    PangoFontDescription *desc;

    //Initializations
    window = GW_SETTINGSWINDOW (data);
    g_return_if_fail (window != NULL);
    priv = window->priv;
    application = gw_window_get_application (GW_WINDOW (window));
    preferences = gw_application_get_preferences (application);
    lw_preferences_get_string_by_schema (preferences, font, LW_SCHEMA_GNOME_INTERFACE, LW_KEY_DOCUMENT_FONT_NAME, 50);
    desc = pango_font_description_from_string (font);
    pango_font_description_set_family (desc, "Serif");
    font2 = pango_font_description_to_string (desc);
    if (font2) text = g_strdup_printf (gettext("_Use the System Document Font (%s)"), font2);
    g_free (font2); font2 = NULL;
    pango_font_description_free (desc); desc = NULL;

    if (text != NULL) 
    {
      gtk_button_set_label (GTK_BUTTON (priv->system_font_checkbutton), text);
      g_free (text);
    }
}
开发者ID:kyoushuu,项目名称:gwaei,代码行数:33,代码来源:settingswindow-callbacks.c


示例8: matekbd_indicator_config_load_font

/**
 * static applet config functions
 */
static void
matekbd_indicator_config_load_font (MatekbdIndicatorConfig * ind_config)
{
    ind_config->font_family =
        g_settings_get_string (ind_config->settings,
                               MATEKBD_INDICATOR_CONFIG_KEY_FONT_FAMILY);

    if (ind_config->font_family == NULL ||
            ind_config->font_family[0] == '\0') {
        PangoFontDescription *fd = NULL;
        GtkStyle *style =
            gtk_rc_get_style_by_paths (gtk_settings_get_default (),
                                       GTK_STYLE_PATH,
                                       GTK_STYLE_PATH,
                                       GTK_TYPE_LABEL);
        if (style != NULL)
            fd = style->font_desc;
        if (fd != NULL) {
            ind_config->font_family =
                g_strdup (pango_font_description_to_string(fd));
        }
    }
    xkl_debug (150, "font: [%s]\n", ind_config->font_family);

}
开发者ID:fatman2021,项目名称:libmatekbd,代码行数:28,代码来源:matekbd-indicator-config.c


示例9: gtk_widget_get_style

gchar *get_font_name_from_widget(GtkWidget *widget) /* MUST BE FREED */
{
	GtkStyle *style;
	
	style = gtk_widget_get_style(widget);
	return pango_font_description_to_string(style->font_desc);
}
开发者ID:Aseeker,项目名称:leafpad,代码行数:7,代码来源:font.c


示例10: _compose_get_font

/* compose_get_font */
static char const * _compose_get_font(Compose * compose)
{
	char const * p;
	char * q;
	GtkSettings * settings;
	PangoFontDescription * desc;

	if((p = config_get(compose->config, NULL, "messages_font")) != NULL)
		return p;
	settings = gtk_settings_get_default();
	g_object_get(G_OBJECT(settings), "gtk-font-name", &q, NULL);
	if(q != NULL)
	{
		desc = pango_font_description_from_string(q);
		g_free(q);
		pango_font_description_set_family(desc, "monospace");
		q = pango_font_description_to_string(desc);
		config_set(compose->config, NULL, "messages_font", q);
		g_free(q);
		pango_font_description_free(desc);
		if((p = config_get(compose->config, NULL, "messages_font"))
				!= NULL)
			return p;
	}
	return MAILER_MESSAGES_FONT;
}
开发者ID:khorben,项目名称:DeforaOS,代码行数:27,代码来源:compose.c


示例11: run_fontsel_settings_dlg

static void
run_fontsel_settings_dlg(SettingsWidget *sw) {
    GtkWidget *dlg;
    const gchar *newfont;
    gchar *oldfont;

    dlg = gtk_font_selection_dialog_new(_("Select font"));
    gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(dlg),
                                            gtk_label_get_text(GTK_LABEL(sw->widget)));

    if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_OK) {
        gtk_label_set_text(GTK_LABEL(sw->widget),
                           gtk_font_selection_dialog_get_font_name(
                               GTK_FONT_SELECTION_DIALOG(dlg)));
    }


    newfont = gtk_label_get_text(GTK_LABEL(sw->widget));
    oldfont = pango_font_description_to_string(
                  pango_context_get_font_description(
                      gtk_widget_get_pango_context(GTK_WIDGET(sw->data))));

    if (newfont && g_ascii_strcasecmp(oldfont, newfont) != 0) {
        string_replace(sw->conf, g_strdup(newfont));
        jam_widget_set_font(sw->widget, newfont);
        jam_widget_set_font(sw->data, newfont);
    }
    g_free(oldfont);

    gtk_widget_destroy(dlg);
}
开发者ID:nightmorph,项目名称:LogJam,代码行数:31,代码来源:settings.c


示例12: pango_font_description_to_string

JNIEXPORT jstring JNICALL
Java_org_gnome_pango_PangoFontDescription_pango_1font_1description_1to_1string
(
	JNIEnv* env,
	jclass cls,
	jlong _self
)
{
	char* result;
	jstring _result;
	PangoFontDescription* self;

	// convert parameter self
	self = (PangoFontDescription*) _self;

	// call function
	result = pango_font_description_to_string(self);

	// cleanup parameter self

	// translate return value to JNI type
	_result = (jstring) bindings_java_newString(env, result);

	// cleanup return value
	if (result != NULL) {
		g_free(result);
	}

	// and finally
	return _result;
}
开发者ID:cyberpython,项目名称:java-gnome,代码行数:31,代码来源:PangoFontDescription.c


示例13: pango_font_description_to_string

string PangoFontInfo::DescriptionName() const {
  if (!desc_) return "";
  char* desc_str = pango_font_description_to_string(desc_);
  string desc_name(desc_str);
  g_free(desc_str);
  return desc_name;
}
开发者ID:11110101,项目名称:tess-two,代码行数:7,代码来源:pango_font_info.cpp


示例14: Clear

bool PangoFontInfo::ParseFontDescription(const PangoFontDescription *desc) {
  Clear();
  const char* family = pango_font_description_get_family(desc);
  if (!family) {
    char* desc_str = pango_font_description_to_string(desc);
    tprintf("WARNING: Could not parse family name from description: '%s'\n",
            desc_str);
    g_free(desc_str);
    return false;
  }
  family_name_ = string(family);
  desc_ = pango_font_description_copy(desc);
  is_monospace_ = IsMonospaceFontFamily(family);

  // Set font size in points
  font_size_ = pango_font_description_get_size(desc);
  if (!pango_font_description_get_size_is_absolute(desc)) {
    font_size_ /= PANGO_SCALE;
  }

  PangoStyle style = pango_font_description_get_style(desc);
  is_italic_ = (PANGO_STYLE_ITALIC == style ||
                PANGO_STYLE_OBLIQUE == style);
  is_smallcaps_ = (pango_font_description_get_variant(desc)
                   == PANGO_VARIANT_SMALL_CAPS);

  is_bold_ = (pango_font_description_get_weight(desc) >= PANGO_WEIGHT_BOLD);
  // We dont have a way to detect whether a font is of type Fraktur. The fonts
  // we currently use all have "Fraktur" in their family name, so we do a
  // fragile but functional check for that here.
  is_fraktur_ = (strcasestr(family, "Fraktur") != NULL);
  return true;
}
开发者ID:11110101,项目名称:tess-two,代码行数:33,代码来源:pango_font_info.cpp


示例15: he_helper_get_logical_font_desc

/**
 * he_helper_get_logical_font_desc:
 * @name: The logical font name (see he-helper.h for possible values)
 *
 * Returns a newly-allocated string that contains the string representation
 * of the Pango font description for the given logical string. This can be
 * used in the font_desc attribute of span elements in Pango markup.
 *
 * This function should be used to get the font desc for Pango markup in
 * special use cases (e.g. GtkTreeView, mixed-content GtkLabel). If you
 * want to set a logical font directly on a widget, you can use
 * #hildon_helper_set_logical_font (from Hildon 2.2) for this.
 *
 * The return value should be freed with g_free() after use.
 **/
gchar *
he_helper_get_logical_font_desc (const gchar *name)
{
    GtkSettings *settings = gtk_settings_get_default();
    GtkStyle *style = gtk_rc_get_style_by_paths(settings,
            name, NULL, G_TYPE_NONE);

    return pango_font_description_to_string(style->font_desc);
}
开发者ID:rlevi,项目名称:xournal,代码行数:24,代码来源:he-helper.c


示例16: get_font_details_from_pattern

static void
get_font_details_from_pattern (FontConfigFont * font, FcPattern * pattern)
{
    int index;
    int slant;
    int weight;
    int width;
    int spacing;
    FcChar8 * file;
    FcChar8 * family;
    FcChar8 * style;

    g_assert(FcInit());
    g_assert(FcPatternGetString(pattern, FC_FILE, 0, &file) == FcResultMatch);
    font_config_font_set_filepath(font, (const gchar *) file);
    font_config_font_set_owner(font, get_file_owner((const gchar *) file));
    g_assert(FcPatternGetString(pattern, FC_FAMILY, 0, &family) == FcResultMatch);
    font_config_font_set_family(font, (const gchar *) family);
    if (FcPatternGetInteger(pattern, FC_INDEX, 0, &index) != FcResultMatch)
        index = 0;
    font_config_font_set_index(font, index);
    if (FcPatternGetInteger(pattern, FC_SPACING, 0, &spacing) != FcResultMatch)
        spacing = FC_PROPORTIONAL;
    font_config_font_set_spacing(font, spacing);
    if (FcPatternGetInteger(pattern, FC_SLANT, 0, &slant) != FcResultMatch)
        slant = FC_SLANT_ROMAN;
    font_config_font_set_slant(font, slant);
    if (FcPatternGetInteger(pattern, FC_WEIGHT, 0, &weight) != FcResultMatch)
        weight = FC_WEIGHT_MEDIUM;
    font_config_font_set_weight(font, weight);
    if (FcPatternGetInteger(pattern, FC_WIDTH, 0, &width) != FcResultMatch)
        width = FC_WIDTH_NORMAL;
    font_config_font_set_width(font, width);
    if (FcPatternGetString (pattern, FC_STYLE, 0, &style) != FcResultMatch) {
        /* Use the same style Pango would if none is given */
        if (weight <= FC_WEIGHT_MEDIUM) {
            if (slant == FC_SLANT_ROMAN)
                font_config_font_set_style(font, "Regular");
            else
                font_config_font_set_style(font, "Italic");
        } else {
            if (slant == FC_SLANT_ROMAN)
                font_config_font_set_style(font, "Bold");
            else
                font_config_font_set_style(font, "Bold Italic");
        }
    } else {
        font_config_font_set_style(font, (const gchar *) style);
    }

    PangoFontDescription * descr = pango_fc_font_description_from_pattern(pattern, FALSE);
    gchar * desc_string = pango_font_description_to_string(descr);
    font_config_font_set_description(font, desc_string);
    pango_font_description_free(descr);
    g_free0(desc_string);
    return;
}
开发者ID:Heether,项目名称:font-manager,代码行数:57,代码来源:_Glue_.c


示例17: font_description_value_to_string

static char *
font_description_value_to_string (const GValue *value)
{
  const PangoFontDescription *desc = g_value_get_boxed (value);

  if (desc == NULL)
    return g_strdup ("none");

  return pango_font_description_to_string (desc);
}
开发者ID:nacho,项目名称:gtk-,代码行数:10,代码来源:gtkcssstringfuncs.c


示例18: gnm_font_button_update_font_data

static void
gnm_font_button_update_font_data (GnmFontButton *font_button)
{
  GnmFontButtonPrivate *priv = font_button->priv;
  PangoFontFamily **families;
  PangoFontFace **faces;
  gint n_families, n_faces, i;
  const gchar *family;

  g_assert (priv->font_desc != NULL);

  priv->fontname = pango_font_description_to_string (priv->font_desc);

  family = pango_font_description_get_family (priv->font_desc);
  if (family == NULL)
    return;

  n_families = 0;
  families = NULL;
  pango_context_list_families (gtk_widget_get_pango_context (GTK_WIDGET (font_button)),
                               &families, &n_families);
  n_faces = 0;
  faces = NULL;
  for (i = 0; i < n_families; i++)
    {
      const gchar *name = pango_font_family_get_name (families[i]);

      if (!g_ascii_strcasecmp (name, family))
        {
          priv->font_family = g_object_ref (families[i]);

          pango_font_family_list_faces (families[i], &faces, &n_faces);
          break;
        }
    }
  g_free (families);

  for (i = 0; i < n_faces; i++)
    {
      PangoFontDescription *tmp_desc = pango_font_face_describe (faces[i]);

      if (font_description_style_equal (tmp_desc, priv->font_desc))
        {
          priv->font_face = g_object_ref (faces[i]);

          pango_font_description_free (tmp_desc);
          break;
        }
      else
        pango_font_description_free (tmp_desc);
    }

  g_free (faces);
}
开发者ID:nzinfo,项目名称:gnumeric,代码行数:54,代码来源:gnm-fontbutton.c


示例19: preferences_set_font

void preferences_set_font (const char *key, const PangoFontDescription *font)
{
        if (font != NULL) {
                char *str;

                str = pango_font_description_to_string (font);
                preferences_set_string (key, str);
        } else {
                preferences_set_string (key, NULL);
        }
}
开发者ID:WarlockFE,项目名称:warlock-gtk,代码行数:11,代码来源:preferences.c


示例20: termomix_increase_font

static void termomix_increase_font(GtkWidget *widget, void *data) {
    gint new_size;

    /* Increment font size one unit */
    new_size = pango_font_description_get_size(termomix.font) + PANGO_SCALE;

    pango_font_description_set_size(termomix.font, new_size);
    termomix_set_font();
    termomix_set_size(termomix.columns, termomix.rows);
    termomix_set_config_string("font",
            pango_font_description_to_string(termomix.font));
}
开发者ID:deathjest3r,项目名称:TERMomix,代码行数:12,代码来源:termomix.c



注:本文中的pango_font_description_to_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pango_font_metrics_unref函数代码示例发布时间:2022-05-30
下一篇:
C++ pango_font_description_set_size函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap