AsposeFontConvertToTTF
AsposeFontConvertToTTF function
Konverterar teckensnittet till TTF-format.
function AsposeFontConvertToTTF(
fileName,
fontType
)
| Parameter | Typ | Beskrivning |
|---|---|---|
| fileName | string | Filnamn. |
| fontType | FontType | Teckensnittstyp att konvertera. |
Returvärde
JSON-objekt
| Fält | Beskrivning |
|---|---|
| errorCode | |
| errorText | |
| fileNameResult |
Exempel
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 AsposeFontConvert to convert font
const json = AsposeFontModule.AsposeFontConvertToTTF(font_file,AsposeFontModule.FontType.TTF,AsposeFontModule.FontSavingFormats.WOFF);
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";
const AsposeFontModule = await AsposeFont();
console.log('Aspose.Font for Node.js via C++ example');
const json = AsposeFontModule.AsposeFontConvertToTTF(font_file,AsposeFontModule.FontType.TTF,AsposeFontModule.FontSavingFormats.WOFF);
console.log("AsposeFontConvert => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
Se även
- function AsposeFontConvert
- enum FontType