1.0.2 โ€ข Published 1 year ago

pseudofont v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

PseudoFont

PseudoFont is a JavaScript library for creating and converting Unicode pseudo fonts. It allows you to define custom fonts where the letters A-Z and digits 0-9 are represented using different Unicode symbols, resulting in a unique and stylized appearance for your text.

Installation

You can install PseudoFont via npm:

npm install pseudofont

Usage

To use PseudoFont in your JavaScript project, follow these steps:

  1. Import the PseudoFont class:
const PseudoFont = require('pseudofont');
  1. Create a new instance of the PseudoFont class by specifying your custom font definitions:
const customFont = new PseudoFont(
  'MyCustomFont',
  '๐’ถ๐’ท๐’ธ๐’นโ„ฏ๐’ปโ„Š๐’ฝ๐’พ๐’ฟ๐“€๐“๐“‚๐“ƒโ„ด๐“…๐“†๐“‡๐“ˆ๐“‰๐“Š๐“‹๐“Œ๐“๐“Ž๐“',
  '๐’œโ„ฌ๐’ž๐’Ÿโ„ฐโ„ฑ๐’ขโ„‹โ„๐’ฅ๐’ฆโ„’โ„ณ๐’ฉ๐’ช๐’ซ๐’ฌโ„›๐’ฎ๐’ฏ๐’ฐ๐’ฑ๐’ฒ๐’ณ๐’ด๐’ต',
  '๐Ÿข๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿง๐Ÿจ๐Ÿฉ๐Ÿช๐Ÿซ'
);
  1. Use the convert method to transform your text into the custom pseudo font:
const convertedText = customFont.convert('Hello World');
console.log(convertedText); // Output: '๐“—๐“ฎ๐“ต๐“ต๐“ธ ๐“ฆ๐“ธ๐“ป๐“ต๐“ญ'

Additional Features

Experimental Fonts

You can mark your custom font as experimental if it is incomplete or unsupported on some platforms. Use the setExperimental method to set the experimental status of your font:

customFont.setExperimental(true);

Example

Here's an example of using PseudoFont to convert text into a custom pseudo font:

const PseudoFont = require('pseudofont');

const customFont = new PseudoFont(
  'MyCustomFont',
  '๐’ถ๐’ท๐’ธ๐’นโ„ฏ๐’ปโ„Š๐’ฝ๐’พ๐’ฟ๐“€๐“๐“‚๐“ƒโ„ด๐“…๐“†๐“‡๐“ˆ๐“‰๐“Š๐“‹๐“Œ๐“๐“Ž๐“',
  '๐’œโ„ฌ๐’ž๐’Ÿโ„ฐโ„ฑ๐’ขโ„‹โ„๐’ฅ๐’ฆโ„’โ„ณ๐’ฉ๐’ช๐’ซ๐’ฌโ„›๐’ฎ๐’ฏ๐’ฐ๐’ฑ๐’ฒ๐’ณ๐’ด๐’ต',
  '๐Ÿข๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿง๐Ÿจ๐Ÿฉ๐Ÿช๐Ÿซ'
);

const convertedText = customFont.convert('Hello World');
console.log(convertedText); // Output: '๐“—๐“ฎ๐“ต๐“ต๐“ธ ๐“ฆ๐“ธ๐“ป๐“ต๐“ญ'
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago