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

C++ pango_font_description_set_family函数代码示例

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

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



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

示例1: pangox_layout_set_font_face

void pangox_layout_set_font_face(PangoLayout *layout, OutputFontFace face)
{
    if (layout != NULL) {
        const PangoFontDescription *old_font;
        PangoFontDescription *new_font;

        if ((old_font = pango_layout_get_font_description(layout)) == NULL) {
            PangoContext *context = pango_layout_get_context(layout);
            new_font = pango_font_description_copy(pango_context_get_font_description(context));
        }
        else {
            new_font = pango_font_description_copy(old_font);
        }
        switch (face) {
            case PS_FONT_SANS: {
                pango_font_description_set_family(new_font, "Sans");
                break;
            }
            case PS_FONT_SERIF: {
                pango_font_description_set_family(new_font, "Serif");
                break;
            }
            default: {
                pango_font_description_set_family(new_font, "Fixed");
                break;
            }
	}
        pango_layout_set_font_description(layout, new_font);
        pango_font_description_free(new_font);
    }
}
开发者ID:nicksexton,项目名称:gui-tools,代码行数:31,代码来源:lib_cairox.c


示例2: pf_setFamily

static void pf_setFamily(JNIEnv* env, jclass, jlong obj, jstring family) {
    if (!obj) return;
    PangoFontDescription* desc = reinterpret_cast<PangoFontDescription*>(obj);
    if (!family) {
        pango_font_description_set_family(desc, "");
        return;
    }
    const char* cfamily = env->GetStringUTFChars(family, nullptr);
    pango_font_description_set_family(desc, cfamily);
    env->ReleaseStringUTFChars(family, cfamily);
}
开发者ID:iamralpht,项目名称:letterplex,代码行数:11,代码来源:JNIPangoFontDescription.cpp


示例3: pango_font_description_new

void wxFontRefData::Init(int pointSize,
                         wxFontFamily family,
                         wxFontStyle style,
                         wxFontWeight weight,
                         bool underlined,
                         const wxString& faceName,
                         wxFontEncoding encoding)
{
    m_family = family == wxFONTFAMILY_DEFAULT ? wxFONTFAMILY_SWISS : family;

    m_underlined = underlined;
    m_encoding = encoding;
    if ( m_encoding == wxFONTENCODING_DEFAULT )
        m_encoding = wxFont::GetDefaultEncoding();

    m_noAA = false;

    // Create native font info
    m_nativeFontInfo.description = pango_font_description_new();

    // And set its values
    if (!faceName.empty())
    {
       pango_font_description_set_family( m_nativeFontInfo.description,
                                           wxGTK_CONV_SYS(faceName) );
    }
    else
    {
        switch (m_family)
        {
            case wxFONTFAMILY_MODERN:
            case wxFONTFAMILY_TELETYPE:
               pango_font_description_set_family( m_nativeFontInfo.description, "monospace" );
               break;
            case wxFONTFAMILY_ROMAN:
               pango_font_description_set_family( m_nativeFontInfo.description, "serif" );
               break;
            case wxFONTFAMILY_SWISS:
               // SWISS = sans serif
            default:
               pango_font_description_set_family( m_nativeFontInfo.description, "sans" );
               break;
        }
    }

    SetStyle( style == wxDEFAULT ? wxFONTSTYLE_NORMAL : style );
    SetPointSize( (pointSize == wxDEFAULT || pointSize == -1)
                    ? wxDEFAULT_FONT_SIZE
                    : pointSize );
    SetWeight( weight == wxDEFAULT ? wxFONTWEIGHT_NORMAL : weight );
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:51,代码来源:font.cpp


示例4: 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


示例5: pango_load

static bool
pango_load (Lisp_Font *f)
{
    PangoLanguage *language;
    PangoFontDescription *fontdesc;
    PangoFont *font;
    PangoFontMetrics *metrics;

    if (pango_context)
    {
	language = pango_context_get_language (pango_context);
    }
    else
    {
	char *langname, *p;

#ifdef HAVE_PANGO_XFT
	pango_context = pango_xft_get_context (dpy, screen_num);
#endif

	langname = g_strdup (setlocale (LC_CTYPE, NULL));
	p = strchr (langname, '.');
	if (p)
	    *p = 0;
	p = strchr (langname, '@');
	if (p)
	    *p = 0;
	language = pango_language_from_string (langname);
	pango_context_set_language (pango_context, language);
	g_free (langname);
    }

    fontdesc = pango_font_description_from_string (rep_STR (f->name));

    if (!pango_font_description_get_family (fontdesc))
	pango_font_description_set_family (fontdesc, "Sans");
    if (pango_font_description_get_size (fontdesc) <= 0)
	pango_font_description_set_size (fontdesc, 12 * PANGO_SCALE);

    pango_context_set_font_description (pango_context, fontdesc);
    font = pango_context_load_font (pango_context, fontdesc);

    if (!font) {
        pango_font_description_free(fontdesc);
	return FALSE;
    }

    metrics = pango_font_get_metrics (font, language);

    f->ascent = metrics->ascent / PANGO_SCALE;
    f->descent = metrics->descent / PANGO_SCALE;

    pango_font_metrics_unref (metrics);

    f->font = fontdesc; /* We save the font description, not the font itself!
                        That's because it seems we can't recover it perfectly
                        later, and the layout routines want a description */

    return TRUE;
}
开发者ID:tkorvola,项目名称:sawfish,代码行数:60,代码来源:fonts.c


示例6: SetUpStatusBarStuff

void SetUpStatusBarStuff (GtkWidget* aWindow)
{
	_String			   fName = baseDirectory & "GTKResources/striped.xpm";
	statusBarLayout			 = pango_layout_new (screenPContext);
	statusBarFontDesc		 = pango_font_description_new ();
	stripedFill				 = gdk_pixmap_create_from_xpm (GDK_DRAWABLE(aWindow->window), NULL, NULL, fName.sData);
	stripedFillGC			 = gdk_gc_new (GDK_DRAWABLE(aWindow->window));
	if (stripedFill)
	{
		gdk_gc_set_fill (stripedFillGC,GDK_TILED);
		gdk_gc_set_tile	(stripedFillGC,stripedFill);
	}
	else
	{
		printf ("Failed to load a status bar .xpm from %s\n", fName.sData);
	}
	
	gdk_gc_set_line_attributes		  (stripedFillGC, 1, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_MITER);
	GdkColor saveFG = {0,0,0,0};
	gdk_gc_set_foreground			  (stripedFillGC, &saveFG);

	pango_font_description_set_family (statusBarFontDesc, statusBarFont.face.sData);
	pango_font_description_set_style  (statusBarFontDesc, (statusBarFont.style & HY_FONT_ITALIC) ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
	pango_font_description_set_weight (statusBarFontDesc, (statusBarFont.style & HY_FONT_BOLD) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL);
	pango_font_description_set_size   (statusBarFontDesc, statusBarFont.size*PANGO_SCALE);
	pango_layout_set_font_description (statusBarLayout, statusBarFontDesc ); // ref ?
	pango_layout_set_width			  (statusBarLayout, -1);
	
	redButtonIcon = (GdkPixbuf*)ProcureIconResource(4000);
	yellowButtonIcon = (GdkPixbuf*)ProcureIconResource(4001);
	greenButtonIcon = (GdkPixbuf*)ProcureIconResource(4002);
	orangeButtonIcon = (GdkPixbuf*)ProcureIconResource(4003);
	
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:34,代码来源:main-GTK.cpp


示例7: _pango_xft_Load

static int
_pango_xft_Load(TextState * ts, const char *name)
{
   FontCtxPangoXft    *fdc;
   PangoFontDescription *font;
   PangoFontMask       flags;

   if (!_pango_ctx)
      _pango_ctx = pango_xft_get_context(disp, Dpy.screen);
   if (!_pango_ctx)
      return -1;

   font = pango_font_description_from_string(name);
   if (!font)
      return -1;

   flags = pango_font_description_get_set_fields(font);
   if ((flags & PANGO_FONT_MASK_FAMILY) == 0)
      pango_font_description_set_family(font, "sans");
   if ((flags & PANGO_FONT_MASK_SIZE) == 0)
      pango_font_description_set_size(font, 10 * PANGO_SCALE);

   fdc = EMALLOC(FontCtxPangoXft, 1);
   if (!fdc)
      return -1;
   fdc->font = font;
   ts->fdc = fdc;
   ts->need_utf8 = 1;
   ts->type = FONT_TYPE_PANGO_XFT;
   ts->ops = &FontOps_pango;
   return 0;
}
开发者ID:burzumishi,项目名称:e16,代码行数:32,代码来源:text_pango.c


示例8: F1035_13190

/* {EV_FONT_IMP}.set_face_name */
void F1035_13190 (EIF_REFERENCE Current, EIF_REFERENCE arg1)
{
	GTCX
	EIF_REFERENCE loc1 = (EIF_REFERENCE) 0;
	EIF_POINTER tp1;
	EIF_POINTER tp2;
	EIF_REFERENCE tr1 = NULL;
	RTLD;
	
	RTLI(4);
	RTLR(0,Current);
	RTLR(1,arg1);
	RTLR(2,tr1);
	RTLR(3,loc1);
	
	RTGC;
	tr1 = F920_10294(RTCV(arg1));
	RTAR(Current, tr1);
	*(EIF_REFERENCE *)(Current + _REFACS_2_) = (EIF_REFERENCE) tr1;
	tr1 = RTOSCF(13229,F1035_13229,(Current));
	loc1 = F1049_13651(RTCV(tr1), arg1);
	tp1 = *(EIF_POINTER *)(Current+ _PTROFF_3_2_0_8_0_0_);
	tp2 = *(EIF_POINTER *)(RTCV(loc1)+ _PTROFF_0_1_0_1_0_0_);
	pango_font_description_set_family((PangoFontDescription*) tp1, (char*) tp2);
	F1035_13198(Current);
	RTLE;
}
开发者ID:yehongbing,项目名称:Eiffel-Projects,代码行数:28,代码来源:ev669.c


示例9: bindings_java_getString

JNIEXPORT void JNICALL
Java_org_gnome_pango_PangoFontDescription_pango_1font_1description_1set_1family
(
	JNIEnv* env,
	jclass cls,
	jlong _self,
	jstring _family
)
{
	PangoFontDescription* self;
	const char* family;

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

	// convert parameter family
	family = (const char*) bindings_java_getString(env, _family);
	if (family == NULL) {
		return; // Java Exception already thrown
	}

	// call function
	pango_font_description_set_family(self, family);

	// cleanup parameter self

	// cleanup parameter family
	bindings_java_releaseString(family);
}
开发者ID:cyberpython,项目名称:java-gnome,代码行数:29,代码来源:PangoFontDescription.c


示例10: UT_return_if_fail

/*!
* \todo ROB parse more attributes like font-color, background-color
*/
void 		 
AP_UnixToolbar_StyleCombo::getPangoAttrs (PD_Style *pStyle, 
										  PangoFontDescription *desc) {

	UT_return_if_fail (pStyle);
	UT_LocaleTransactor t (LC_NUMERIC, "C");

	const gchar *value = NULL;

	if (pStyle->getPropertyExpand ("font-family", value)) {
		pango_font_description_set_family (desc, value);
	}

	if (pStyle->getPropertyExpand ("font-size", value)) {
		pango_font_description_set_size (desc, (gint)(UT_convertToDimension (value, DIM_PT) * PANGO_SCALE));
	}

	if (pStyle->getPropertyExpand ("font-style", value)) {
		PangoStyle style = PANGO_STYLE_NORMAL;
		if (!strcmp (value, "italic"))
			style = PANGO_STYLE_ITALIC;
		pango_font_description_set_style (desc, style);
	}

	if (pStyle->getPropertyExpand ("font-weight", value)) {
		PangoWeight weight = PANGO_WEIGHT_NORMAL;
		if (!strcmp (value, "bold"))
			weight = PANGO_WEIGHT_BOLD;
		pango_font_description_set_weight (desc, weight);
	}
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:34,代码来源:ap_UnixToolbar_StyleCombo.cpp


示例11: WXUNUSED

void wxFontRefData::Init(int pointSize,
                         wxFontFamily family,
                         wxFontStyle style,
                         wxFontWeight weight,
                         bool underlined,
                         bool strikethrough,
                         const wxString& faceName,
                         wxFontEncoding WXUNUSED(encoding))
{
    if (family == wxFONTFAMILY_DEFAULT)
        family = wxFONTFAMILY_SWISS;

    m_underlined = underlined;
    m_strikethrough = strikethrough;

    // Create native font info
    m_nativeFontInfo.description = pango_font_description_new();

    // And set its values
    if (!faceName.empty())
    {
        pango_font_description_set_family( m_nativeFontInfo.description,
                                           wxGTK_CONV_SYS(faceName) );
    }
    else
    {
        SetFamily(family);
    }

    SetStyle( style == wxDEFAULT ? wxFONTSTYLE_NORMAL : style );
    SetPointSize( (pointSize == wxDEFAULT || pointSize == -1)
                    ? wxDEFAULT_FONT_SIZE
                    : pointSize );
    SetWeight( weight == wxDEFAULT ? wxFONTWEIGHT_NORMAL : weight );
}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:35,代码来源:font.cpp


示例12: _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


示例13: get_pango_font_description_from_info

static PangoFontDescription *
get_pango_font_description_from_info (gchar *font_family, gchar *font_weight, gint font_size)
{
	PangoFontDescription *description = NULL;
	PangoWeight pw = PANGO_WEIGHT_NORMAL;

	g_assert(font_family);
	g_assert(font_weight);
	g_assert(font_size > 0);

	description = pango_font_description_new();
	pango_font_description_set_family(description, font_family);

	if (!g_strcmp0(font_weight, "bold")) {
		pw = PANGO_WEIGHT_BOLD;
	} else {
		pw = PANGO_WEIGHT_NORMAL;
	}

	pango_font_description_set_weight(description, pw);

	pango_font_description_set_size(description,
					font_size * PANGO_SCALE);

	return description;
}
开发者ID:stringtang,项目名称:pad-keyboard,代码行数:26,代码来源:gtk-misc-utility.c


示例14: main

int main(int argc, char **argv)
{
  GtkWidget *win;
  GtkButton *button;
  PangoFontDescription *pd;

  gtk_init(&argc, &argv);
  win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title(GTK_WINDOW(win), "Basic Animation");
  g_signal_connect(G_OBJECT(win), "delete-event", gtk_main_quit, NULL);

  label = (GtkLabel *)gtk_label_new(hello);

  // since we shift a whole character per time, it's better to use
  // a monospace font, so that the shifting seems done at the same pace
  pd = pango_font_description_new();
  pango_font_description_set_family(pd, "monospace");
  gtk_widget_modify_font(GTK_WIDGET(label), pd);

  button = (GtkButton *)gtk_button_new();
  gtk_container_add(GTK_CONTAINER(button), GTK_WIDGET(label));

  gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(button));
  g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(change_dir), NULL);

  slen = strlen(hello);

  g_timeout_add(125, scroll_it, NULL);

  gtk_widget_show_all(GTK_WIDGET(win));
  gtk_main();
  return 0;
}
开发者ID:Anatolt,项目名称:RosettaCodeData,代码行数:33,代码来源:animation.c


示例15: add_text

static void add_text(cairo_surface_t* surface, int x, int y, int size, const char* text)
{
	cairo_t* cr = cairo_create(surface);
	cairo_set_source_rgb(cr, 1., 1., 1.);

	PangoLayout* layout = pango_cairo_create_layout(cr);
	pango_layout_set_text(layout, text, -1);
	PangoFontDescription* desc = pango_font_description_new();
	pango_font_description_set_family(desc, "sans");
	pango_font_description_set_weight(desc, PANGO_WEIGHT_BOLD);
	pango_font_description_set_absolute_size(desc, size * PANGO_SCALE);
	pango_layout_set_font_description(layout, desc);
	pango_font_description_free(desc);

	int w = 0;
	int h = 0;
	pango_layout_get_pixel_size(layout, &w, &h);

	cairo_move_to(cr, (x >= 0) ? x : -(x + (double)w),
			  (y >= 0) ? y : -(y + (double)h));

	pango_cairo_show_layout(cr, layout);

	g_object_unref(layout);
	cairo_destroy(cr);
}
开发者ID:mrirecon,项目名称:view,代码行数:26,代码来源:view.c


示例16: pango_font_description_from_string

font_instance *font_factory::FaceFromDescr(char const *family, char const *style)
{
    PangoFontDescription *temp_descr = pango_font_description_from_string(style);
    pango_font_description_set_family(temp_descr,family);
    font_instance *res = Face(temp_descr);
    pango_font_description_free(temp_descr);
    return res;
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:8,代码来源:FontFactory.cpp


示例17: HYFont2PangoFontDesc

void HYFont2PangoFontDesc (const _HYFont& f, PangoFontDescription* theFont)
{
	pango_font_description_set_family (theFont, f.face.sData);
	pango_font_description_set_style  (theFont, (f.style & HY_FONT_ITALIC) ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
	pango_font_description_set_weight (theFont, (f.style & HY_FONT_BOLD) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL);
	pango_font_description_set_size   (theFont, f.size*PANGO_SCALE);
	//pango_font_description_set_absolute_size (theFont, f.size*PANGO_SCALE);
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:8,代码来源:HYPlatformGraphicPane.cpp


示例18: gdk_threads_enter

JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkClasspathFontPeer_setFont
  (JNIEnv *env, jobject self, jstring family_name_str, jint style_int, jint size)
{
  struct peerfont *pfont = NULL;
  PangoFontMap *map = NULL; 
  char const *family_name = NULL;

  gdk_threads_enter ();
  enum java_awt_font_style style = (enum java_awt_font_style) style_int;

  g_assert (self != NULL);
  pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, self);
  g_assert (pfont != NULL);

  if (pfont->ctx != NULL)
    g_object_unref (pfont->ctx);
  if (pfont->font != NULL)
    g_object_unref (pfont->font);
  if (pfont->desc != NULL)
    pango_font_description_free (pfont->desc);

  pfont->desc = pango_font_description_new ();
  g_assert (pfont->desc != NULL);

  family_name = (*env)->GetStringUTFChars(env, family_name_str, 0);
  g_assert (family_name != NULL);
  pango_font_description_set_family (pfont->desc, family_name);
  (*env)->ReleaseStringUTFChars(env, family_name_str, family_name);

  pango_font_description_set_size (pfont->desc, size * PANGO_SCALE);  

  if (style & java_awt_font_BOLD)
    pango_font_description_set_weight (pfont->desc, PANGO_WEIGHT_BOLD);

  if (style & java_awt_font_ITALIC)
    pango_font_description_set_style (pfont->desc, PANGO_STYLE_ITALIC);
  
  /* 
     FIXME: these are possibly wrong, and should in any case
     probably be cached between calls.
   */

  map = pango_ft2_font_map_for_display ();
  g_assert (map != NULL);
  
  if (pfont->ctx == NULL)
    pfont->ctx = pango_ft2_font_map_create_context (PANGO_FT2_FONT_MAP (map));  
  g_assert (pfont->ctx != NULL);

  if (pfont->font != NULL)
    g_object_unref (pfont->font);

  pfont->font = pango_font_map_load_font (map, pfont->ctx, pfont->desc);
  g_assert (pfont->font != NULL);

  gdk_threads_leave ();
}
开发者ID:zylin,项目名称:zpugcc,代码行数:57,代码来源:gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c


示例19: pango_font_description_set_family

bool wxNativeFontInfo::SetFaceName(const wxString& facename)
{
    pango_font_description_set_family(description, wxPANGO_CONV(facename));

    // we return true because Pango doesn't tell us if the call failed or not;
    // instead on wxGTK wxFont::SetFaceName() will call wxFontBase::SetFaceName()
    // which does the check
    return true;
}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:9,代码来源:fontutil.cpp


示例20: loadfont

static struct fontmap *
loadfont(char *fontalias, int font_style, int *symbol)
{
  struct fontmap *fcur;
  PangoFontDescription *pfont;
  PangoStyle style;
  PangoWeight weight;

  *symbol = FALSE;

  if (nhash_get_ptr(Gra2cairoConf->fontmap, fontalias, (void *) &fcur)) {
    int i;

    if (nhash_get_int(CompatibleFontHash, fontalias, &i) == 0) {
      if (nhash_get_ptr(Gra2cairoConf->fontmap, CompatibleFont[i].name, (void *) &fcur) == 0) {
	font_style = CompatibleFont[i].style;
	*symbol = CompatibleFont[i].symbol;
      }
    }
    if (fcur == NULL && nhash_get_ptr(Gra2cairoConf->fontmap, DEFAULT_FONT, (void *) &fcur)) {
      return NULL;
    }
  }

  if (fcur->font) {
    pfont = fcur->font;
  } else {
    gchar *ptr;
    pfont = pango_font_description_new();

    ptr = g_strdup_printf("%s%s%s", fcur->fontname, (fcur->alternative) ? "," : "", CHK_STR(fcur->alternative));
    if (ptr) {
      pango_font_description_set_family(pfont, ptr);
      g_free(ptr);
    } else {
      return NULL;
    }
  }

  if (font_style > 0 && (font_style & GRA_FONT_STYLE_ITALIC)) {
    style = PANGO_STYLE_ITALIC;
  } else {
    style = PANGO_STYLE_NORMAL;
  }
  pango_font_description_set_style(pfont, style);

  if (font_style > 0 && (font_style & GRA_FONT_STYLE_BOLD)) {
    weight = PANGO_WEIGHT_BOLD;
  } else {
    weight = PANGO_WEIGHT_NORMAL;
  }
  pango_font_description_set_weight(pfont, weight);

  fcur->font = pfont;

  return fcur;
}
开发者ID:htrb,项目名称:ngraph-gtk,代码行数:57,代码来源:ogra2cairo.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ pango_font_description_set_size函数代码示例发布时间:2022-05-30
下一篇:
C++ pango_font_description_new函数代码示例发布时间: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