AsposeFontConvert
AsposeFontConvert function
Convierte la fuente a otro formato.
function AsposeFontConvert(
fileName,
fontType,
fontSavingFormat
)
| Parámetro | Tipo | Descripción |
|---|---|---|
| fileName | string | Nombre de archivo. |
| fontType | FontType | Tipo de fuente a convertir. |
| fontSavingFormat | FontSavingFormats | Formato de fuente al que convertir. |
Valor de retorno
Objeto JSON
| Campo | Descripción |
|---|---|
| errorCode | |
| errorText | |
| fileNameResult |
Observaciones
Nota: El tipo de fuente TTF ahora solo está soportado.
Ejemplos
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.AsposeFontConvert(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";
console.log('Aspose.Font for Node.js via C++ example');
const AsposeFontModule = await AsposeFont();
const json = AsposeFontModule.AsposeFontConvert(font_file,AsposeFontModule.FontType.TTF,AsposeFontModule.FontSavingFormats.WOFF);
console.log("AsposeFontConvert => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
Ver también
- enum FontType
- enum FontSavingFormats