An open API service indexing awesome lists of open source software.

https://github.com/ntnyq/weird-glyph

:package: Transform common glyphs to weird glyphs.
https://github.com/ntnyq/weird-glyph

weird-glyph

Last synced: 7 months ago
JSON representation

:package: Transform common glyphs to weird glyphs.

Awesome Lists containing this project

README

          

# weird-glyph

[![CI](https://github.com/ntnyq/weird-glyph/workflows/CI/badge.svg)](https://github.com/ntnyq/weird-glyph/actions)
[![NPM VERSION](https://img.shields.io/npm/v/weird-glyph.svg)](https://www.npmjs.com/package/weird-glyph)
[![NPM DOWNLOADS](https://img.shields.io/npm/dy/weird-glyph.svg)](https://www.npmjs.com/package/weird-glyph)
[![LICENSE](https://img.shields.io/github/license/ntnyq/weird-glyph.svg)](https://github.com/ntnyq/weird-glyph/blob/main/LICENSE)

## Install

```shell
npm i weird-glyph -D
```

```shell
yarn add weird-glyph -D
```

```shell
pnpm add weird-glyph -D
```

## Usage

```ts
// config/index.ts

import { weirdGlyph } from 'weird-glyph'

console.log(
weirdGlyph('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', {
category: 'script',
variant: 'regular',
}),
)
// cSpell: disable-next-line
// => ๐’œโ„ฌ๐’ž๐’Ÿโ„ฐโ„ฑ๐’ขโ„‹โ„๐’ฅ๐’ฆโ„’โ„ณ๐’ฉ๐’ช๐’ซ๐’ฌโ„›๐’ฎ๐’ฏ๐’ฐ๐’ฑ๐’ฒ๐’ณ๐’ด๐’ต๐’ถ๐’ท๐’ธ๐’นโ„ฏ๐’ปโ„Š๐’ฝ๐’พ๐’ฟ๐“€๐“๐“‚๐“ƒโ„ด๐“…๐“†๐“‡๐“ˆ๐“‰๐“Š๐“‹๐“Œ๐“๐“Ž๐“
```

## API

### weirdGlyph

- **Type**: `(input: string, options: Options) => string`

## Interface

```ts
export type Options = {
category: WeirdGlyphCategory
variant: WeirdGlyphVariant
}

/**
* Weird glyph category
*/
export type WeirdGlyphCategory =
| 'circle'
| 'currency'
| 'double-struck'
| 'fancy'
| 'fraktur'
| 'latin'
| 'monospace'
| 'sans-serif'
| 'script'
| 'serif'
| 'square'

/**
* Weird glyph variant
*/
export type WeirdGlyphVariant =
| 'arrow'
| 'black'
| 'bold-italic'
| 'bold'
| 'cross'
| 'dot'
| 'extended'
| 'fireworks'
| 'happy'
| 'italic'
| 'line'
| 'regular'
| 'sad'
| 'slash'
| 'smallcaps'
| 'tildestrikethrough'
| 'upside'
| 'winding'
| 'xabove'
```

## License

[MIT](./LICENSE) License ยฉ 2025-PRESENT [ntnyq](https://github.com/ntnyq)