Manipulating CSS Font Properties In JavaScript – fontjs

Category: Javascript , Text | January 24, 2018
Author:ilovecode1
Views Total:62 views
Official Page:Go to website
Last Update:January 24, 2018
License:MIT

Preview:

Manipulating CSS Font Properties In JavaScript – fontjs

Description:

fontjs is a lightweight font manipulation library used to dynamically set CSS font properties (font family, font size, font weight, etc) in JavaScript.

How to use it:

Download and import the font.js into the document.

<script src="font.js"></script>

Create a new instance of the fontjs.

var instance = Font("instance");

Specify the font you want to load.

instance.setURL(url)

Specify the font style.

instance.setStyle(style)

Specify the font size.

instance.setSize(size)

Specify the font weight.

instance.setWeight(weight)

Specify the font variant.

instance.setVariant(variant)

Specify the font stretch.

instance.setStrech(strech)

You Might Be Interested In:


Leave a Reply