From 28a6dcfdd6f7166a4f04b5107cf03b8182092ef2 Mon Sep 17 00:00:00 2001 From: Marco Botton Date: Tue, 6 May 2014 11:19:16 +0200 Subject: [PATCH] Load font file in FontConfig when using Pango --- src/FontFace.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/FontFace.cc b/src/FontFace.cc index e739a5aad..deafe964b 100644 --- a/src/FontFace.cc +++ b/src/FontFace.cc @@ -8,6 +8,8 @@ #include +#include + Persistent FontFace::constructor; /* @@ -81,6 +83,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);