From 7522aca2ea7d4e38752cfef807b31ba1a419d58f Mon Sep 17 00:00:00 2001 From: Jake Gordon Date: Tue, 9 Dec 2014 09:38:57 +0000 Subject: [PATCH] with_pango to true and use fontconfig to load fonts --- binding.gyp | 2 +- src/FontFace.cc | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 binding.gyp mode change 100644 => 100755 src/FontFace.cc diff --git a/binding.gyp b/binding.gyp old mode 100644 new mode 100755 index b4f9162..afb7323 --- a/binding.gyp +++ b/binding.gyp @@ -13,7 +13,7 @@ 'with_jpeg%': ' + Persistent 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);