|
@ -6,6 +6,8 @@ |
|
|
|
|
|
|
|
|
#include "FontFace.h" |
|
|
#include "FontFace.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <fontconfig/fontconfig.h> |
|
|
|
|
|
|
|
|
Persistent<FunctionTemplate> FontFace::constructor; |
|
|
Persistent<FunctionTemplate> FontFace::constructor; |
|
|
|
|
|
|
|
|
/*
|
|
|
/*
|
|
@ -79,6 +81,14 @@ NAN_METHOD(FontFace::New) { |
|
|
return NanThrowError("Could not load font file"); |
|
|
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.
|
|
|
// Create new cairo font face.
|
|
|
crFace = cairo_ft_font_face_create_for_ft_face(ftFace, 0); |
|
|
crFace = cairo_ft_font_face_create_for_ft_face(ftFace, 0); |
|
|
|
|
|
|
|
|