diff --git a/lib/canvas.js b/lib/canvas.js index 686905f..cd40e37 100644 --- a/lib/canvas.js +++ b/lib/canvas.js @@ -430,7 +430,6 @@ Context2d.prototype.__defineSetter__('shadowColor', function(val){ Context2d.prototype.__defineGetter__('shadowColor', normalizedColor('lastShadowColor')); Context2d.prototype.__defineSetter__('font', function(val){ - console.log(val); if ('string' == typeof val) { var font; if (font = parseFont(val)) { diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index ba19218..62b52f3 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -815,6 +815,9 @@ Context2d::SetFont(const Arguments &args) { Context2d *context = ObjectWrap::Unwrap(args.This()); cairo_t *ctx = context->getContext(); + // Size + cairo_set_font_size(ctx, size); + // Style cairo_font_slant_t slant = CAIRO_FONT_SLANT_NORMAL; if (0 == strcmp("italic", *style)) slant = CAIRO_FONT_SLANT_ITALIC; @@ -845,7 +848,6 @@ Context2d::FillText(const Arguments &args) { Context2d *context = ObjectWrap::Unwrap(args.This()); cairo_t *ctx = context->getContext(); cairo_text_extents_t te; - cairo_set_font_size(ctx, 20); // TODO: relative cairo_move_to(ctx, x, y); cairo_show_text(ctx, *str);