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

C++ cairo_set_font_size函数代码示例

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

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



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

示例1: _cairo_user_scaled_font_create_meta_context

static cairo_t *
_cairo_user_scaled_font_create_meta_context (cairo_user_scaled_font_t *scaled_font)
{
    cairo_content_t content;
    cairo_surface_t *meta_surface;
    cairo_t *cr;

    content = scaled_font->base.options.antialias == CAIRO_ANTIALIAS_SUBPIXEL ?
						     CAIRO_CONTENT_COLOR_ALPHA :
						     CAIRO_CONTENT_ALPHA;

    meta_surface = cairo_meta_surface_create (content, NULL);
    cr = cairo_create (meta_surface);
    cairo_surface_destroy (meta_surface);

    cairo_set_matrix (cr, &scaled_font->base.scale);
    cairo_set_font_size (cr, 1.0);
    cairo_set_font_options (cr, &scaled_font->base.options);
    cairo_set_source_rgb (cr, 1., 1., 1.);

    return cr;
}
开发者ID:angerangel,项目名称:livecode-thirdparty,代码行数:22,代码来源:cairo-user-font.c


示例2: thisBounds

void Label_t::update()
{
	Rectangle thisBounds(0, 0, getBounds().width, getBounds().height);

	// Check if the component was ever layouted, otherwise set to a high value
	if (!thisBounds.width && !thisBounds.height)
	{
		thisBounds.width = 9999;
		thisBounds.height = 9999;
	}

	// get text bounds
	cr = graphics.getContext();
	cairo_set_font_face(cr, font->getFace());
	cairo_set_font_size(cr, fontSize);
	cairo_text_extents(cr, this->text.c_str(), &lastExtents);
	Dimension newPreferred(lastExtents.width + 3, lastExtents.height + 3);

	// Set new preferred size
	if (getPreferredSize() != newPreferred) setPreferredSize(newPreferred);
	markFor(COMPONENT_REQUIREMENT_PAINT);
}
开发者ID:MarcoCicognani,项目名称:MeetiX-OS-Project,代码行数:22,代码来源:label.cpp


示例3: affiche_serieL2

void affiche_serieL2(grille G,cairo_t *cr) {
	int *serieL;
	char *tab=(char*)calloc(10,sizeof(char));
	int i,j;
	for(i=0;i<G->n;i++){
		serieL=serie_pointL(G,i);
		for(j=1;j<((G->m+1)/2)+1;j++)	{
			if (serieL[j]!=0) {
				cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); 
				cairo_select_font_face(cr,
				"cairo:",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL);
				cairo_set_font_size(cr, 20);
				cairo_move_to(cr, (G->m*((int)width))+j*30,30+i*((int)width));
				//printf("%d\n",serieL[j]);
				sprintf(tab,"%2d",serieL[j]);
				cairo_show_text(cr,tab);  
			}
			else break;
		}
		free(serieL);
	}
}
开发者ID:J4g0n,项目名称:logigraphe,代码行数:22,代码来源:interaction.c


示例4: render_date

int render_date(cairo_t *cairo, int x, int y, int d) {
	time_t rawnow = time(NULL);
	struct tm *now = localtime(&rawnow);
	char date_string[256];

	strftime(date_string, 256, conf->datefmt, now);

	set_cairo_source_colour(cairo, conf->datecol);
	cairo_set_font_face(cairo, conf->datefont);
	cairo_set_font_size(cairo, conf->datefontsize);

	cairo_text_extents_t extents;
	cairo_text_extents(cairo, date_string, &extents);

	int render_x = x;
	if(d == RIGHT) render_x = x - extents.width;

	cairo_move_to(cairo, render_x, y);
	cairo_show_text(cairo, date_string);

	return extents.width - 1;
}
开发者ID:Mnib,项目名称:bLifebar,代码行数:22,代码来源:render.c


示例5: do_drawing

void do_drawing(cairo_t *cr, GtkWidget *widget)
{
  cairo_text_extents_t extents;

  GtkWidget *win = gtk_widget_get_toplevel(widget);
  
  gint width, height;
  gtk_window_get_size(GTK_WINDOW(win), &width, &height);  
  
  gint x = width/2;
  gint y = height/2;
  
  cairo_set_source_rgb(cr, 0.5, 0, 0); 
  cairo_paint(cr);   

  cairo_select_font_face(cr, "Courier",
      CAIRO_FONT_SLANT_NORMAL,
      CAIRO_FONT_WEIGHT_BOLD);
 
  glob.size += 0.8;

  if (glob.size > 20) {
      glob.alpha -= 0.01;
  }

  cairo_set_font_size(cr, glob.size);
  cairo_set_source_rgb(cr, 1, 1, 1); 

  cairo_text_extents(cr, "ZetCode", &extents);
  cairo_move_to(cr, x - extents.width/2, y);
  cairo_text_path(cr, "ZetCode");
  cairo_clip(cr);

  cairo_paint_with_alpha(cr, glob.alpha);
  
  if (glob.alpha <= 0) {
      glob.timer = FALSE;
  }     
}
开发者ID:wiggni,项目名称:cpro,代码行数:39,代码来源:puff.c


示例6: startMenuDraw

void startMenuDraw(cairo_t *cairoDrawPlace, field_t *field)
{
    int i, j;
    char shipName[20][20] = {"ARCANE",
                             "WING",
                             "VERTIGO",
                             "YOMEN",
                             "OMEGA", 
                             "HERO",
                             "SKULL"};
    cairo_set_source_rgba(cairoDrawPlace, 1, 1, 1, 1);
    cairo_set_font_size(cairoDrawPlace, 16);
    cairo_move_to(cairoDrawPlace, 7 * pixelConst, 2 * pixelConst);
    cairo_show_text(cairoDrawPlace, "Choose ship:"); 
    for (i = 0; i <= SKULL; i++) {
        if (field->shipType == i) {
            cairo_rectangle(cairoDrawPlace, 6 * pixelConst, 2 * (i + 2) * pixelConst, pixelConst, -pixelConst);
        }
        cairo_move_to(cairoDrawPlace, 8 * pixelConst, 2 * (i + 2) * pixelConst - 1);
        cairo_show_text(cairoDrawPlace, shipName[i]); 
    }
    cairo_move_to(cairoDrawPlace, pixelConst, 2 * (i + 4) * pixelConst);
    cairo_show_text(cairoDrawPlace, "Arrows - move."); 
    cairo_move_to(cairoDrawPlace,  pixelConst, 2 * (i + 5) * pixelConst);
    cairo_show_text(cairoDrawPlace, "'z' - fire/start."); 
    cairo_stroke(cairoDrawPlace);

    for (i = 0; i < field->size.y; i++) {
        for (j = 0; j < field->size.x; j++) {
            if (field->values[i][j] == SHIP) {
                cairo_set_source_rgba(cairoDrawPlace, 1, 0.85, 0, 1);
                cairo_rectangle(cairoDrawPlace, j * pixelConst, i * pixelConst, pixelConst, pixelConst);
                cairo_fill(cairoDrawPlace);
                cairo_stroke(cairoDrawPlace);
            }
        }
    }
    cairo_stroke(cairoDrawPlace);
}
开发者ID:evheny0,项目名称:epic-spaceride,代码行数:39,代码来源:graphics.c


示例7: do_drawing

/* Perform the actual drawing of the entries */
static void do_drawing(GtkWidget *widget, cairo_t *cr) {

    /* How much space was the window actually allocated? */
    GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
    gtk_widget_get_allocation(GTK_WIDGET(widget), allocation);
    display_width = allocation->width;
    display_height = allocation->height;

    /* Allocation no longer needed */
    g_free(allocation);
   
    /* Set cairo drawing variables */
    cairo_set_source_rgb(cr, 0, 0, 0);
    cairo_select_font_face(cr, "Helvetica",
                           CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size(cr, 20);
    cairo_set_line_width(cr, 1);
    cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER);
    
    /* Begin drawing the nodes */
    draw_tree(cr, root_entry);
}
开发者ID:BartMassey,项目名称:duvis,代码行数:23,代码来源:graphics.c


示例8: main

int main (void)
{
	cairo_surface_t *surface;
	cairo_t *cr;

	surface = cairo_svg_surface_create ("image.svg", 504, 648);
	cr = cairo_create (surface);

	cairo_set_source_rgb (cr, 0, 0, 0);
	cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
	cairo_set_font_size (cr, 40.0);

	cairo_move_to (cr, 10.0, 50.0);
	cairo_show_text (cr, "Hello world!");

	cairo_show_page (cr);

	cairo_surface_destroy (surface);
	cairo_destroy (cr);

	return 0;
}
开发者ID:4179e1,项目名称:misc,代码行数:22,代码来源:svg.c


示例9: text_extents

void text_extents(char * text, double * w, double * h)
{
    fontface * face = NULL;
    cairo_text_extents_t text_extents;
    double tmp_w, tmp_h;

    face = hash_get(faces, "__DEFAULT__");

    cairo_set_font_face(main_context, face->cface);
    cairo_set_font_size(main_context, _DEFAULT_FONT_SIZE);

    // will have to keep subtracting from the previous amount to determine
    // the width of the current "line"
    while ( text[0] != '\0' )
    {
        cairo_text_extents(main_context, text, &text_extents);
        text += strcspn(text, "\n") + 1;
    }

    *w = text_extents.width;
    *h = text_extents.height;
}
开发者ID:bartgrantham,项目名称:fasttext,代码行数:22,代码来源:fasttext.c


示例10: do_twin

static cairo_perf_ticks_t
do_twin (cairo_t *cr,
	 int width,
	 int height,
	 int loops)
{
    int i, j, h;
    unsigned char s[2] = {0, 0};

    cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
    cairo_paint (cr);
    cairo_set_source_rgb (cr, 0, 0, 0);

    cairo_select_font_face (cr,
			    "@cairo:",
			    CAIRO_FONT_SLANT_NORMAL,
			    CAIRO_FONT_WEIGHT_NORMAL);

    cairo_perf_timer_start ();

    while (loops--) {
	h = 2;
	for (i = 8; i < 48; i >= 24 ? i+=3 : i++) {
	    cairo_set_font_size (cr, i);
	    for (j = 33; j < 128; j++) {
		if (j == 33 || (j == 80 && i > 24)) {
		    h += i + 2;
		    cairo_move_to (cr, 10, h);
		}
		s[0] = j;
		cairo_text_path (cr, (const char *) s);
	    }
	}
	cairo_fill (cr);
    }

    cairo_perf_timer_stop ();
    return cairo_perf_timer_elapsed ();
}
开发者ID:jaglass,项目名称:WinCairoRequirements,代码行数:39,代码来源:twin.c


示例11: draw_cb

static gboolean draw_cb(GtkWidget *widget, cairo_t *cr, gpointer data)
{
  cairo_set_source_rgb (cr, 1,1,1);
  cairo_paint (cr);

  cairo_surface_t *g_surface;
  
  g_surface = cairo_image_surface_create_for_data (scratch, CAIRO_FORMAT_A8,
      s_width, s_height, s_width);

  cairo_set_source_rgb (cr, 1,0,0);
  cairo_translate (cr, 0, 0);
  cairo_mask_surface (cr, g_surface, 0, 0);
  cairo_fill (cr);

  cairo_surface_destroy (g_surface);
  cairo_set_source_rgb (cr, 0,0,0);
  
  cairo_select_font_face(cr, "Sans",
      CAIRO_FONT_SLANT_NORMAL,
      CAIRO_FONT_WEIGHT_NORMAL);
  cairo_set_font_size(cr, 20);

  char buf[4096];
  float y = 0.0;
  float x = 300;

  sprintf (buf, "alpha: %2.2f%%", 100 * alpha);
  cairo_move_to (cr, x, y+=30);
  cairo_show_text (cr, buf);


  sprintf (buf, "beta: %2.2f%%", 100 * beta);
  cairo_move_to (cr, x, y+=30);
  cairo_show_text (cr, buf);

  return FALSE;
}
开发者ID:LetterModeller,项目名称:kernagic,代码行数:38,代码来源:gray.c


示例12: render_alarm

int render_alarm(cairo_t *cairo, uint32_t alarm_s, int x, int y, int d) {
	struct tm *atm = malloc(sizeof *atm);
	memset(atm, 0, sizeof *atm);
	char *format = malloc(32);
	sprintf(format, "%s", "%M:%S");
	char time_string[128];

	while(alarm_s >= 3600) {
		atm->tm_hour++;
		alarm_s -= 3600;
		sprintf(format, "%s", "%H:%M:%S");
	}
	while(alarm_s >= 60) {
		atm->tm_min++;
		alarm_s -= 60;
	}
	atm->tm_sec = alarm_s;


	strftime(time_string, 128, format, atm);
	free(atm);
	free(format);

	set_cairo_source_colour(cairo, conf->alarmcol);
	cairo_set_font_face(cairo, conf->timefont);
	cairo_set_font_size(cairo, conf->timefontsize);

	cairo_text_extents_t extents;
	cairo_text_extents(cairo, time_string, &extents);

	int render_x = x;
	if(d == RIGHT) render_x = x - extents.width;

	cairo_move_to(cairo, render_x, y);
	cairo_show_text(cairo, time_string);

	return extents.width - 1;
}
开发者ID:Mnib,项目名称:bLifebar,代码行数:38,代码来源:render.c


示例13: draw

static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
    cairo_text_extents_t extents;
    cairo_font_options_t *font_options;
    const char black[] = "black", blue[] = "blue";

    /* We draw in the default black, so paint white first. */
    cairo_save (cr);
    cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
    cairo_paint (cr);
    cairo_restore (cr);

    cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Sans",
			    CAIRO_FONT_SLANT_NORMAL,
			    CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, TEXT_SIZE);

    font_options = cairo_font_options_create ();
    cairo_get_font_options (cr, font_options);
    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
    cairo_set_font_options (cr, font_options);

    cairo_font_options_destroy (font_options);

    cairo_set_source_rgb (cr, 0, 0, 0); /* black */
    cairo_text_extents (cr, black, &extents);
    cairo_move_to (cr, -extents.x_bearing, -extents.y_bearing);
    cairo_show_text (cr, black);
    cairo_translate (cr, 0, -extents.y_bearing + 1);

    cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
    cairo_text_extents (cr, blue, &extents);
    cairo_move_to (cr, -extents.x_bearing, -extents.y_bearing);
    cairo_show_text (cr, blue);

    return CAIRO_TEST_SUCCESS;
}
开发者ID:499940913,项目名称:moon,代码行数:38,代码来源:text-antialias-gray.c


示例14: sp_canvastext_render

static void
sp_canvastext_render (SPCanvasItem *item, SPCanvasBuf *buf)
{
    SPCanvasText *cl = SP_CANVASTEXT (item);

    if (!buf->ct)
        return;

    cairo_set_font_size(buf->ct, cl->fontsize);

    if (cl->background) {
        cairo_text_extents_t extents;
        cairo_text_extents(buf->ct, cl->text, &extents);

        cairo_rectangle(buf->ct, item->x1 - buf->rect.left(),
                        item->y1 - buf->rect.top(),
                        item->x2 - item->x1,
                        item->y2 - item->y1);

        ink_cairo_set_source_rgba32(buf->ct, cl->rgba_background);
        cairo_fill(buf->ct);
    }

    Geom::Point s = cl->s * cl->affine;
    double offsetx = s[Geom::X] - cl->anchor_offset_x - buf->rect.left();
    double offsety = s[Geom::Y] - cl->anchor_offset_y - buf->rect.top();

    cairo_move_to(buf->ct, round(offsetx), round(offsety));
    cairo_text_path(buf->ct, cl->text);

    if (cl->outline) {
        ink_cairo_set_source_rgba32(buf->ct, cl->rgba_stroke);
        cairo_set_line_width (buf->ct, 2.0);
        cairo_stroke_preserve(buf->ct);
    }
    ink_cairo_set_source_rgba32(buf->ct, cl->rgba);
    cairo_fill(buf->ct);
}
开发者ID:NotBrianZach,项目名称:modalComposableProgrammableFuzzySearchingVectorGraphicEditing,代码行数:38,代码来源:canvas-text.cpp


示例15: draw_input_box

void draw_input_box(cairo_t * cc,
        const uint16_t width, const uint16_t height,
        const uint32_t fg,    const uint32_t bg,
        const uint32_t pad,   const int len) {
    // U+25CF BLACK CIRCLE, UTF-8 encoding
    static const char dot[] = {0xE2, 0x97, 0x8F, 0x00};
    cairo_set_font_size(cc, TEXT_SIZE * 0.75);
    cairo_select_font_face(cc, "Sans",
            CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);

    cairo_text_extents_t te;
    cairo_text_extents(cc, dot, &te);

    int show_len = MIN(len, PASS_SHOW_LEN);
    // draw the outer box
    uint16_t x = 0, y = 0, w = 0, h = 0;
    w = te.width * show_len + pad * (show_len - 1) + te.height;
    h = te.height * 2;
    x = (width -  w) / 2;
    y = (height - h) / 2;

    cairo_set_source_uint32(cc, fg);
    cairo_rectangle(cc, x, y, w, h);
    cairo_set_line_width(cc, TEXT_SIZE / 10);
    cairo_stroke(cc);

    // draw text
    int i = 0;
    w = te.width * show_len + pad * (show_len - 1);
    h = te.height;
    x = (width -  w) / 2;
    y = (height - h) / 2;
    for (i = 0; i < show_len; i++) {
        cairo_move_to(cc,
            x + i * (te.width + pad) - te.x_bearing, y - te.y_bearing);
        cairo_show_text(cc, dot);
    }
}
开发者ID:wsmithril,项目名称:wslock,代码行数:38,代码来源:lock_screen.c


示例16: draw

static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
    /* We draw in the default black, so paint white first. */
    cairo_save (cr);
    cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
    cairo_paint (cr);
    cairo_restore (cr);

    cairo_select_font_face (cr, "Bitstream Vera Sans",
			    CAIRO_FONT_SLANT_NORMAL,
			    CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, TEXT_SIZE);

    cairo_set_source_rgb (cr, 0, 0, 0); /* black */

    cairo_boilerplate_scaled_font_set_max_glyphs_cached (cairo_get_scaled_font (cr), 1);

    cairo_move_to (cr, 1, TEXT_SIZE);
    cairo_show_text (cr, "the five boxing wizards jump quickly");

    return CAIRO_TEST_SUCCESS;
}
开发者ID:3oyka,项目名称:cairo2,代码行数:23,代码来源:glyph-cache-pressure.c


示例17: cairo_set_operator

void PdfView::drawPage(PdfCache* cache, XojPopplerPage* popplerPage, cairo_t* cr,
					   double zoom, double width, double height, bool forPrinting)
{
	if (popplerPage)
	{
		if (cache && !forPrinting)
		{
			cache->render(cr, popplerPage, zoom);
		}
		else
		{
			popplerPage->render(cr, forPrinting);
		}

		if (!forPrinting)
		{
			cairo_set_operator(cr, CAIRO_OPERATOR_DEST_OVER);
			cairo_set_source_rgb(cr, 1., 1., 1.);
		}
		cairo_paint(cr);
	}
	else
	{
		cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
							CAIRO_FONT_WEIGHT_BOLD);
		cairo_set_font_size(cr, 26);

		cairo_set_source_rgb(cr, 0.8, 0.8, 0.8);

		cairo_text_extents_t extents = { 0 };
		string strMissing = _("PDF background missing");

		cairo_text_extents(cr, strMissing.c_str(), &extents);
		cairo_move_to(cr, width / 2 - extents.width / 2, height / 2 - extents.height / 2);
		cairo_show_text(cr, strMissing.c_str());
	}
}
开发者ID:project-renard-survey,项目名称:xournalpp,代码行数:37,代码来源:PdfView.cpp


示例18: draw

static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
    cairo_font_options_t *options;

    cairo_set_source_rgb (cr, 1, 1, 1);
    cairo_paint (cr);
    cairo_set_source_rgb (cr, 0, 0, 0);

    cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);

    cairo_select_font_face (cr,
			    "@cairo:",
			    CAIRO_FONT_SLANT_NORMAL,
			    CAIRO_FONT_WEIGHT_NORMAL);

    options = cairo_font_options_create ();
    cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_NONE);
    cairo_set_font_options (cr, options);
    cairo_font_options_destroy (options);

    cairo_set_font_size (cr, 16);

    cairo_move_to (cr, 4, 14);
    cairo_show_text (cr, "Is cairo's twin giza?");

    cairo_move_to (cr, 4, 34);
    cairo_text_path (cr, "Is cairo's twin giza?");
    cairo_fill (cr);

    cairo_move_to (cr, 4, 54);
    cairo_text_path (cr, "Is cairo's twin giza?");
    cairo_set_line_width (cr, 2/16.);
    cairo_stroke (cr);

    return CAIRO_TEST_SUCCESS;
}
开发者ID:AZed,项目名称:cairo,代码行数:37,代码来源:twin-antialias-none.c


示例19: draw_chip

/* Drawing of the whole bunch */
void
draw_chip(drawing_context_t *ctx, const chip_descr_t *chip) {
  cairo_t *cr = ctx->cr;

  debit_log(L_DRAW, "Start of draw chip");

  /* This should be after zoom, in user coordinates */

  /* paint the clip region */
  cairo_set_source_rgb (cr, 0., 0., 0.);
  cairo_paint (cr);

  /* draw everything in white. This could be per-site or per-site-type */
  cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
  cairo_set_line_width (cr, 1);

  cairo_select_font_face(cr, NAME_FONT_TYPE,
			 CAIRO_FONT_SLANT_NORMAL,
			 CAIRO_FONT_WEIGHT_NORMAL);
  cairo_set_font_size(cr, NAME_FONT_SIZE);

  /* initialize patterns -- once and for all ? */
/*   if (!ctx->site_sing_patterns[CLB]) */
/*     ctx->site_sing_patterns[CLB] = draw_clb_pattern(ctx); */

/*   if (!ctx->site_full_patterns[CLB]) */
/*     ctx->site_full_patterns[CLB] = draw_full_clb_pattern(ctx, chip); */
/*   cairo_save (cr); */
/*   cairo_set_source (cr, ctx->site_full_patterns[CLB]); */
/*   cairo_paint (cr); */
/*   cairo_restore (cr); */

  /* move from the context */
  draw_chip_for_window(ctx, chip);

  debit_log(L_DRAW, "End of draw chip");
}
开发者ID:Martoni,项目名称:debit,代码行数:38,代码来源:sites_draw.c


示例20: gui_post_expose

void gui_post_expose(struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height,
                     int32_t pointerx, int32_t pointery)
{
  dt_iop_colorout_gui_data_t *g = (dt_iop_colorout_gui_data_t *)self->gui_data;
  if(g->softproof_enabled)
  {
    gchar *label = g->softproof_enabled == DT_SOFTPROOF_GAMUTCHECK ? _("gamut check") : _("soft proof");
    cairo_set_source_rgba(cr, 0.5, 0.5, 0.5, 0.5);
    cairo_text_extents_t te;
    cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    cairo_set_font_size(cr, 20);
    cairo_text_extents(cr, label, &te);
    cairo_move_to(cr, te.height * 2, height - (te.height * 2));
    cairo_text_path(cr, label);
    cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
    cairo_fill_preserve(cr);
    cairo_set_line_width(cr, 0.7);
    cairo_set_source_rgb(cr, 0.3, 0.3, 0.3);
    cairo_stroke(cr);
  }

  const int force_lcms2 = dt_conf_get_bool("plugins/lighttable/export/force_lcms2");
  if(force_lcms2)
  {
    gtk_widget_set_no_show_all(g->cbox1, FALSE);
    gtk_widget_set_visible(g->cbox1, TRUE);
    gtk_widget_set_no_show_all(g->cbox4, FALSE);
    gtk_widget_set_visible(g->cbox4, TRUE);
  }
  else
  {
    gtk_widget_set_no_show_all(g->cbox1, TRUE);
    gtk_widget_set_visible(g->cbox1, FALSE);
    gtk_widget_set_no_show_all(g->cbox4, TRUE);
    gtk_widget_set_visible(g->cbox4, FALSE);
  }
}
开发者ID:MarcelloPerathoner,项目名称:darktable,代码行数:37,代码来源:colorout.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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