Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jviereck committed Jun 24, 2012
1 parent e594f52 commit fa54e2b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion lib/context2d.js
Expand Up @@ -99,7 +99,6 @@ var parseFont = exports.parseFont = function(str){
return cache[str] = font;
};


/**
* Create a pattern from `Image` or `Canvas`.
*
Expand Down
6 changes: 1 addition & 5 deletions src/CanvasRenderingContext2d.cc
Expand Up @@ -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);
Expand All @@ -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));
}

Expand Down Expand Up @@ -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();
}
Expand Down
1 change: 0 additions & 1 deletion src/CanvasRenderingContext2d.h
Expand Up @@ -16,7 +16,6 @@
#include <cairo-ft.h>
#include FT_FREETYPE_H

#include <string>
#include <vector>
using namespace std;

Expand Down
6 changes: 3 additions & 3 deletions src/TrueTypeFont.cc
Expand Up @@ -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")));
}
Expand Down
1 change: 1 addition & 0 deletions src/init.cc
Expand Up @@ -29,3 +29,4 @@ init (Handle<Object> target) {
}

NODE_MODULE(canvas,init);

0 comments on commit fa54e2b

Please sign in to comment.