AsposeFontSetInfo
AsposeFontSetInfo function
Set info (metadata) into a Font-file.
function AsposeFontSetInfo(
fileName,
nameId,
platformId,
platformSpecificId,
languageId,
text
)
Parameter | Type | Description |
---|---|---|
fileName | string | File name. |
nameId | TtfNameTableNameId | Name identifier, logical string category, specified by NameId enumeration |
platformId | TtfNameTablePlatformId | Platform identifier |
platformSpecificId | int | Platform-specific encoding identifier. Please, use value from one of such enumerations - UnicodePlatformSpecificId , MacPlatformSpecificId , MSPlatformSpecificId . What enumeration to use is defined by context (platformId parameter) |
languageId | int | Language identifier. Please, use value from MSLanguageId or MacLanguageId enumerations depend from context, defined by platformId parameter. |
text | string | Actual string data |
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++ examples.");
AsposeFont().then(AsposeFontModule => {
//AsposeSetInfo - set metadata info into font
const nameId = AsposeFontModule.TtfNameTableNameId.Description;
const platformId = AsposeFontModule.TtfNameTablePlatformId.Microsoft;
const platformSpecificId = AsposeFontModule.TtfNameTableMSPlatformSpecificId.Unicode_BMP_UCS2.value;
const langID = Module.TtfNameTableMSLanguageId.English_United_States.value;
const text = "Updated description";
const json = AsposeFontSetInfo(font_file, nameId, platformId, platformSpecificId, langID, text);
console.log("AsposeFontSetInfo => %O", json.errorCode == 0 ? 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();
//AsposeSetInfo - set metadata info into font
const nameId = AsposeFontModule.TtfNameTableNameId.Description;
const platformId = AsposeFontModule.TtfNameTablePlatformId.Microsoft;
const platformSpecificId = AsposeFontModule.TtfNameTableMSPlatformSpecificId.Unicode_BMP_UCS2.value;
const langID = Module.TtfNameTableMSLanguageId.English_United_States.value;
const text = "Updated description";
const json = AsposeFontModule.AsposeFontSetInfo(font_file, nameId, platformId, platformSpecificId, langID, text);
console.log("AsposeFontSetInfo => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);