AsposeFontConvertToTTF | API Solution for Node.js
Contents
[
Hide
Show
]How to convert the font into TTF format using Aspose.Font for Node.js?
- Call AsposeFontConvertToTTF function.
- The resulting name file is set, in
json.fileNameResult
. - If the
json.errorCode
is 0, then you can get links to result files. If thejson.errorCode
parameter is not equal to 0 and, versa, there will be an error in your file, then information about such an error will be contained in thejson.errorText
.
Below is the sample which converts Type1
font to TTF
format.
1 const AsposeFont = require('asposefontnodejs');
2
3 const font_file = "./fonts/acade1.afm";
4
5 console.log('Aspose.Font for Node.js via C++ example');
6
7 AsposeFont().then(AsposeFontModule => {
8 //call AsposeFontConvertToTTF to convert font
9 const json = AsposeFontModule.AsposeFontConvertToTTF(font_file,AsposeFontModule.FontType.Type1);
10 console.log("AsposeFontConvertToTTF : %O", json.errorCode == 0 ? font_file + ' => ' + json.fileNameResult : json.errorText);
11 });
*Replace path/to/your/font.afm with the actual path to your font file.
With Aspose.Font for Node.js, you can effortlessly switch between font formats and ensure your projects always have the perfect look and feel!
See Also
- function AsposeFontConvert
- enum FontType