Browse Source

expose freetype version

v1.x
Linus Unnebäck 9 years ago
parent
commit
9b58be5e8a
  1. 8
      lib/canvas.js
  2. 7
      src/init.cc

8
lib/canvas.js

@ -56,6 +56,14 @@ if (canvas.gifVersion) {
exports.gifVersion = canvas.gifVersion.replace(/[^.\d]/g, ''); exports.gifVersion = canvas.gifVersion.replace(/[^.\d]/g, '');
} }
/**
* freetype version.
*/
if (canvas.freetypeVersion) {
exports.freetypeVersion = canvas.freetypeVersion;
}
/** /**
* Expose constructors. * Expose constructors.
*/ */

7
src/init.cc

@ -15,6 +15,7 @@
#ifdef HAVE_FREETYPE #ifdef HAVE_FREETYPE
#include "FontFace.h" #include "FontFace.h"
#include FT_FREETYPE_H
#endif #endif
// Compatibility with Visual Studio versions prior to VS2015 // Compatibility with Visual Studio versions prior to VS2015
@ -70,6 +71,12 @@ NAN_MODULE_INIT(init) {
target->Set(Nan::New<String>("gifVersion").ToLocalChecked(), Nan::New<String>(GIF_LIB_VERSION).ToLocalChecked()); target->Set(Nan::New<String>("gifVersion").ToLocalChecked(), Nan::New<String>(GIF_LIB_VERSION).ToLocalChecked());
#endif #endif
#endif #endif
#ifdef HAVE_FREETYPE
char freetype_version[10];
snprintf(freetype_version, 10, "%d.%d.%d", FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH);
target->Set(Nan::New<String>("freetypeVersion").ToLocalChecked(), Nan::New<String>(freetype_version).ToLocalChecked());
#endif
} }
NODE_MODULE(canvas,init); NODE_MODULE(canvas,init);

Loading…
Cancel
Save