Browse Source

Merge pull request #490 from AllYearbooks/master

re-enable pango, use fontconfig and floats for drawImage()
v1.x
Juriy Zaytsev 10 years ago
parent
commit
9a3bde4e3c
  1. 2
      binding.gyp
  2. 2
      src/CanvasRenderingContext2d.cc
  3. 10
      src/FontFace.cc

2
binding.gyp

@ -13,7 +13,7 @@
'with_jpeg%': '<!(./util/has_lib.sh jpeg)',
'with_gif%': '<!(./util/has_lib.sh gif)',
# disable pango as it causes issues with freetype.
'with_pango%': 'false',
'with_pango%': '<!(./util/has_lib.sh pangocairo)',
'with_freetype%': '<!(./util/has_cairo_freetype.sh)'
}
}]

2
src/CanvasRenderingContext2d.cc

@ -606,7 +606,7 @@ NAN_METHOD(Context2d::DrawImage) {
if (args.Length() < 3)
return NanThrowTypeError("invalid arguments");
int sx = 0
float sx = 0
, sy = 0
, sw = 0
, sh = 0

10
src/FontFace.cc

@ -6,6 +6,8 @@
#include "FontFace.h"
#include <fontconfig/fontconfig.h>
Persistent<FunctionTemplate> FontFace::constructor;
/*
@ -79,6 +81,14 @@ NAN_METHOD(FontFace::New) {
return NanThrowError("Could not load font file");
}
#if HAVE_PANGO
// Load the font file in fontconfig
FcBool ok = FcConfigAppFontAddFile(FcConfigGetCurrent(), (FcChar8 *)(*filePath));
if (!ok) {
return NanThrowError("Could not load font in FontConfig");
}
#endif
// Create new cairo font face.
crFace = cairo_ft_font_face_create_for_ft_face(ftFace, 0);

Loading…
Cancel
Save