AsposeFontGetInfo
AsposeFontGetInfo function
Get info (metadata) from a Font-file.
function AsposeFontGetInfo(
fileName
)
Parameter | Type | Description |
---|---|---|
fileName | string | File name. |
Return Value
JSON object
Field | Description |
---|---|
errorCode | code error (0 no error) |
errorText | text error ("" no error) |
records | Array of JSON objects : |
* NameId | name identifier |
* PlatformId | platform identifier |
* PlatformSpecificId | platform-specific identifier |
* LanguageId | language identifier |
* Info | content of name record |
Examples
Common js modules:
const AsposeFont = require('asposefontnodejs');
const font_file = "./fonts/Lora-Regular.ttf";
console.log("Aspose.Font for Node.js via C++ examples.");
AsposeFont().then(AsposeFontModule => {
//AsposeFontGetInfo - get metadata information
const json = AsposeFontModule.AsposeFontGetInfo(font_file);
console.log("AsposeFontGetInfo => %O", json.errorCode == 0 ? json.records.reduce((ret, a) => ret +
"\nNameId : " + a.NameId
+ "; PlatformId : " + a.PlatformId
+ "; PlatformSpecificId : " + a.PlatformSpecificId
+ "; LanguageId : " + a.LanguageId
+ "; Info : " + a.Info,"") : json.errorText);
});
ECMAScript\ES6 js modules::
import AsposeFont from 'asposefontnodejs';
const font_file ="./fonts/arial.ttf";
console.log('Aspose.Font for Node.js via C++ example');
const AsposeFontModule = await AsposeFont();
//AsposeFontGetInfo - get metadata font information
json = AsposeFontModule.AsposeFontGetInfo(font_file);
console.log("AsposeFontGetInfo => %O", json.errorCode == 0 ? json.records.reduce((ret, a) => ret +
"\nNameId : " + a.NameId
+ "; PlatformId : " + a.PlatformId
+ "; PlatformSpecificId : " + a.PlatformSpecificId
+ "; LanguageId : " + a.LanguageId
+ "; Info : " + a.Info,"") : json.errorText);