Browse Source

Merge pull request #718 from LinusU/freetype-version

expose freetype version
v1.x
Linus Unnebäck 9 years ago
parent
commit
b28a48284c
  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, '');
}
/**
* freetype version.
*/
if (canvas.freetypeVersion) {
exports.freetypeVersion = canvas.freetypeVersion;
}
/**
* Expose constructors.
*/

7
src/init.cc

@ -15,6 +15,7 @@
#ifdef HAVE_FREETYPE
#include "FontFace.h"
#include FT_FREETYPE_H
#endif
// 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());
#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);

Loading…
Cancel
Save