asposepagenodejs
Version:
Aspose.Page for Node.js via C++
79 lines (56 loc) • 3.86 kB
Markdown
# Node.js API to Manipulate Font Files
Add font manipulation and conversion features to your Node.js applications.
[Aspose.Font for Node.js via C++](https://products.aspose.com/font/nodejs-cpp/) allows convert ttf, otf, cff, type1 font files to ttf and svg formats, read and write truetype font metadata information.
<p align="center">
<a title="Download complete Aspose.Font for Node.js via C++ code" href="https://releases.aspose.com/font/nodejs-cpp/new-releases/">
<img src="https://raw.github.com/AsposeExamples/java-examples-dashboard/master/images/downloadZip-Button-Large.png" />
</a>
</p>
## Font Processing via C++
- [Load font files from disc](https://docs.aspose.com/font/cpp/loading-saving-cff-fonts/) as well as stream.
- Read font information and save updated font files to disc.
- Support for [*TrueType* and *OpenType*](https://docs.aspose.com/font/cpp/working-with-truetype-and-opentype-fonts/) Fonts.
- Work with [CFF](https://docs.aspose.com/font/cpp/working-with-cff-fonts/) & [Type1 fonts](https://docs.aspose.com/font/cpp/working-with-type1-fonts/) in your C++ Apps.
- Read Glyphs and Metrics information from Font files.
- Detect Latin Symbols in Fonts.
- Extract embedded licensing information from font files.
- Render text using font Glyphs.
## Read & Write Font Formats
TTF
## Read Font Formats
TTC, OpenType, CFF, Type1
## System Requirements
Aspose.Font for Node.js is developed to work in Node.js environment. It is recommended to use Node.js latest version (20.14 and above)
## Get Started with Aspose.Font for NodeJS via C++
Are you ready to give Aspose.Font for C++ a try? Simply execute `npm install asposefontnodejs`. If you already have Aspose.Font for C++ and want to upgrade the version, please execute `npm update asposefontnodejs` to get the latest version.
Use AsposeFontforNode
- in your cjs:
```
const AsposeFont = require('asposefontnodejs');
```
- or mjs modules:
```
import AsposeFont from 'asposefontnodejs';
```
## Examples of getting metadata
1. Run the [AsposeFontGetInfo](https://reference.aspose.com/font/nodejs-cpp/metadata/asposefontgetinfo/) function.
2. In case the `json.errorCode` is 0, you can get the result data. When the `json.errorCode` parameter is not equal to 0 and, accordingly, you will receive an error in your file, then information about such an error will be contained in the `json.errorText`.
3. The resulting json object contains `records` array. Each record contains fields `NameId`, `PlatformId`, `PlatformSpecificId`, `LanguageId`, `Info` with information from `name` table of font.
```js
const AsposeFont = require('asposefontnodejs');
const font_file = "./fonts/12380_C0_0.cff";
console.log('Aspose.Font for Node.js via C++ example');
AsposeFont().then(AsposeFontModule => {
//AsposeFontGetInfo - get metadata information
const json = AsposeFontModule.AsposeFontGetInfo(font_file);
console.log("AsposeFontGetInfo => %O", json.errorCode == 0 ? json.records.reduce((ret, a) => ret +
"\nNameId : " + a.NameId
+ "; PlatformId : " + a.PlatformId
+ "; PlatformSpecificId : " + a.PlatformSpecificId
+ "; LanguageId : " + a.LanguageId
+ "; Info : " + a.Info,"") : json.errorText);
},
reason => {console.log(`The unknown error has occurred: ${reason}`);}
);
```
[Home](https://www.aspose.com/) | [Product Page](https://products.aspose.com/font/cpp) | [Docs](https://docs.aspose.com/font/cpp/) | [API Reference](https://apireference.aspose.com/font/cpp) | [Examples](https://github.com/aspose-font/Aspose.Font-for-C/tree/master/Examples) | [Blog](https://blog.aspose.com/category/font/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/font) | [Temporary License](https://purchase.aspose.com/temporary-license)