Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose freetype version #718

Merged
merged 1 commit into from Mar 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/canvas.js
Expand Up @@ -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.
*/
Expand Down
7 changes: 7 additions & 0 deletions src/init.cc
Expand Up @@ -15,6 +15,7 @@

#ifdef HAVE_FREETYPE
#include "FontFace.h"
#include FT_FREETYPE_H
#endif

// Compatibility with Visual Studio versions prior to VS2015
Expand Down Expand Up @@ -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);