cairo_move_to (ctx,20,50);cairo_select_font_face(ctx,"Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size (ctx,45); cairo_set_source_rgb (ctx,1.0,1.0,1.0); cairo_show_text (ctx, priv->time);cairo_select_font_face(ctx,"Sans", CAIRO_FONT_SLANT_NORMAL,...
例子1: 直接生成一个PNG图片,在上面用自定义的字体和颜色写Hello World#include <cairo.h>intmain (int argc, char *argv[]){ cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80); cairo_t *cr = cairo_create (surface); cairo_select_font_face (cr, "serif"...
g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold); g.SetFontSize(24); TextExtents te; Text.ShadowedText(g,"Time", X + x1, Y + y1); Text.ShadowedText(g,"Gil", X + x1, Y + y2); g.SelectFontFace("Courier New", FontSlant.Normal, FontWeight.Bold);longs,...
cairo_select_font_face(PECL cairo >= 0.1.0) CairoContext::selectFontFace -- cairo_select_font_face— The selectFontFace purpose说明面向对象风格 (method):public CairoContext::selectFontFace ( string $family [, int $slant [, int $weight ]] ) : void过程化风格:...
? ?cairo_set_source_rgb ( cr, 0.627 , 0 , 0 ) ; 设置源的颜色为 darkred,就好比是选择了暗红色的颜料。 ? ?cairo_select_font_face( cr, Adobe Heiti Std , CAIRO_FONT_SLANT_NORMAL, ? ? ? CAIRO_FONT_WEIGHT_NORMAL) ; ?cairo_set_font_size( cr, 24.0 ) ; 选择字体类型并设置其尺寸...
cairo_text_extents_t te; cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); cairo_select_font_face (cr, Georgia, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size (cr, 1.2); cairo_text_extents (cr, a, te); cairo_move_to (cr, WIDTH / 2 - te.width / 2, ...