About Aspose.Font for JavaScript | API for JavaScript

Overview

The Aspose.Font for JavaScript library represents information about engine library name, release version, and licensing status.

How to get information about the library?

  1. Just run the AsposeFontAbout function.
  2. Next, if the json.errorCode is 0, then the result json contains fields product, version, islicensed with info about the library. If the json.errorCode parameter is not equal to 0 then error information will be contained in the json.errorText.

Below is the sample which gets info about the library on load:

 1  var onloadAsposeFontforJS = function () {
 2    var Module_onRuntimeInitialized = Module['onRuntimeInitialized'];
 3    Module['onRuntimeInitialized'] = async function() {
 4        console.log('AsposeFontforJS has loaded');
 5        await Module_onRuntimeInitialized();
 6        //Get info about Product
 7        const json = AsposeFontAbout();
 8        if (json.errorCode == 0) document.getElementById('output').textContent = "Product      : " + json.product
 9                                                                             + "\nVersion      : " + json.version
10                                                                             + "\nIs licensed  : " + json.islicensed;
11        else document.getElementById('output').textContent = json.errorText;
12    }
13  }

or using Web Worker:

 1  /*Create Web Worker*/
 2<script type="text/javascript">
 3  const AsposeFontWebWorker = new Worker("AsposeFontforJS.js");
 4  AsposeFontWebWorker.onerror = evt => console.log(`Error from Web Worker: ${evt.message}`);
 5  AsposeFontWebWorker.onmessage = evt => {
 6	if (evt.data == 'ready')
 7      AsposeFontWebWorker.postMessage({ "operation": 'AsposeFontAbout', "params": [] }, []);
 8	else
 9	  document.getElementById('output').textContent = (evt.data.json.errorCode == 0) ?
10         `Product      : ${evt.data.json.product}`
11     + `\nVersion      : ${evt.data.json.version}`
12     + `\nIs licensed  : ${evt.data.json.islicensed}` :
13        `Error: ${evt.data.json.errorText}`;
14  };
15</script>

How to get the solution?

If you are interested in getting the library, go to Aspose.Font for JavaScript product page. There you will find more opportunities that the solution gives you. You can download a free trial from or buy the product there.

If you have any troubles or questions left, feel free to post them at the Aspose.Font.Product Family section of the Free Support Forum and within a few hours our support team will clear everything up for you.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.