Permalink
Browse files

Cleanup

  • Loading branch information...
1 parent e594f52 commit fa54e2ba92b084be1a66c5dfa03e60240eaa8b3a @jviereck committed Jun 24, 2012
Showing with 5 additions and 10 deletions.
  1. +0 −1 lib/context2d.js
  2. +1 −5 src/CanvasRenderingContext2d.cc
  3. +0 −1 src/CanvasRenderingContext2d.h
  4. +3 −3 src/TrueTypeFont.cc
  5. +1 −0 src/init.cc
View
@@ -99,7 +99,6 @@ var parseFont = exports.parseFont = function(str){
return cache[str] = font;
};
-
/**
* Create a pattern from `Image` or `Canvas`.
*
@@ -1625,7 +1625,6 @@ Context2d::PrepareTrueTypeFace(const Arguments &args) {
return ThrowException(Exception::TypeError(String::New("TrueTypeFontFace expected")));
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This());
- cairo_t *ctx = context->context();
cairo_font_face_t *cr_face;
TrueTypeFontFace *face = ObjectWrap::Unwrap<TrueTypeFontFace>(obj);
@@ -1635,9 +1634,6 @@ Context2d::PrepareTrueTypeFace(const Arguments &args) {
vector<cairo_font_face_t*> *font_faces = context->font_faces();
font_faces->insert(font_faces->end(), cr_face);
- cairo_set_font_face(ctx, cr_face);
- printf("=== PrepareTrueTypeFace %p %p %d\n", context, font_faces, int(font_faces->size()));
-
return scope.Close(Number::New(font_faces->size() - 1));
}
@@ -1712,7 +1708,7 @@ Context2d::SetFont(const Arguments &args) {
w = CAIRO_FONT_WEIGHT_BOLD;
}
- cairo_select_font_face(ctx, *family, s, w);
+ cairo_select_font_face(ctx, *family, s, w);
return Undefined();
}
@@ -16,7 +16,6 @@
#include <cairo-ft.h>
#include FT_FREETYPE_H
-#include <string>
#include <vector>
using namespace std;
View
@@ -45,20 +45,20 @@ TrueTypeFontFace::New(const Arguments &args) {
}
String::AsciiValue filePath(args[0]);
- int faceIdx = int(args[1]->NumberValue());
+ int faceIdx = int(args[1]->NumberValue());
FT_Face ft_face; /* handle to face object */
FT_Error ft_error;
if (_initLibrary) {
_initLibrary = false;
- ft_error = FT_Init_FreeType( &library );
+ ft_error = FT_Init_FreeType(&library);
if (ft_error) {
return ThrowException(Exception::Error(String::New("Could not load library")));
}
}
- ft_error = FT_New_Face( library, *filePath, faceIdx, &ft_face );
+ ft_error = FT_New_Face(library, *filePath, faceIdx, &ft_face);
if (ft_error) {
return ThrowException(Exception::Error(String::New("Could not load font file")));
}
View
@@ -29,3 +29,4 @@ init (Handle<Object> target) {
}
NODE_MODULE(canvas,init);
+

0 comments on commit fa54e2b

Please sign in to comment.