AsposeFontGetBasicProperties

AsposeFontGetBasicProperties function

Returns basic font properties: family name, style, and font type.

function AsposeFontGetBasicProperties(
    fileBlob,
    fileName
)
ParameterTypeDescription
fileBlobBlob objectContent of source font for convert.
fileNamestringFile name.

Return Value

JSON object

FieldDescription
errorCodecode error (0 no error)
errorTexttext error ("" no error)
familyNameFont family name
styleFont style
fontTypeFont type

Examples

const AsposeFont = require('asposefontnodejs');

const font_file = "./fonts/Lora-Regular.ttf";

console.log("Aspose.Font for Node.js via C++ examples.");

AsposeFont().then(AsposeFontModule => {

    //AsposeFontGetBasicProperties - Returns basic font properties: family name, style, and font type.
    const json = AsposeFontModule.AsposeFontGetBasicProperties(font_file);
    console.log("AsposeFontGetBasicProperties => %O",  json.errorCode == 0 ? "Family name : "  + json.familyName + "; Style: " + json.style + "; Font type: " + json.fontType : 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();

//AsposeFontGetBasicProperties - Returns basic font properties: family name, style, and font type.
json = AsposeFontModule.AsposeFontGetBasicProperties(font_file);
console.log("AsposeFontGetBasicProperties => %O",  json.errorCode == 0 ? "Family name : "  + json.familyName + "; Style: " + json.style + "; Font type: " + json.fontType : json.errorText);