AsposeFontConvertToWOFF
AsposeFontConvertToWOFF function
Converts the Font into WOFF format.
function AsposeFontConvertToWOFF(
fileName,
fontType
)
Parameter | Type | Description |
---|---|---|
fileName | string | File name. |
fontType | FontType | Font type to convert. |
Return Value
JSON object
Field | Description |
---|---|
errorCode | code error (0 no error) |
errorText | text error ("" no error) |
fileNameResult | result file name |
Examples
Common js modules:
const AsposeFont = require('asposefontnodejs');
const font_file = "./fonts/Lora-Regular.ttf";
console.log('Aspose.Font for Node.js via C++ example');
AsposeFont().then(AsposeFontModule => {
//call AsposeFontConvertToWOFF to convert font
const json = AsposeFontModule.AsposeFontConvertToWOFF(font_file,AsposeFontModule.FontType.TTF);
console.log("AsposeFontConvert : %O", json.errorCode == 0 ? font_file + ' => ' + json.fileNameResult : 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();
const json = AsposeFontModule.AsposeFontConvertToWOFF(font_file,AsposeFontModule.FontType.TTF);
console.log("AsposeFontConvert => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
See Also
- function AsposeFontConvert
- enum FontType