UNPKG

2.07 kBMarkdownView Raw
1# matoran-alphabet
2
3Package for drawing Matoran alphabet characters
4
5[![npm](https://img.shields.io/npm/v/matoran-alphabet.svg)](https://npmjs.com/package/matoran-alphabet)
6[![node](https://img.shields.io/node/v/matoran-alphabet.svg)](https://nodejs.org)
7
8[![dependencies](https://img.shields.io/david/JrMasterModelBuilder/matoran-alphabet.svg)](https://david-dm.org/JrMasterModelBuilder/matoran-alphabet)
9[![size](https://packagephobia.now.sh/badge?p=matoran-alphabet)](https://packagephobia.now.sh/result?p=matoran-alphabet)
10[![downloads](https://img.shields.io/npm/dm/matoran-alphabet.svg)](https://npmcharts.com/compare/matoran-alphabet?minimal=true)
11
12[![Build Status](https://github.com/JrMasterModelBuilder/matoran-alphabet/workflows/main/badge.svg?branch=main)](https://github.com/JrMasterModelBuilder/matoran-alphabet/actions?query=workflow%3Amain+branch%3Amain)
13
14
15# Overview
16
17Currently supports drawing multiple different character styles as SVG code.
18
19
20# Usage
21
22## Basic Usage
23
24```js
25import {CharactersRound, SvgEncoder} from 'matoran-alphabet';
26
27const characters = new CharactersRound();
28const svg = new SvgEncoder(characters);
29console.log(svg.encode('A'));
30```
31
32## Characters Styles
33
34Multple styles are available.
35
36- `CharactersRound`
37- `CharactersHex1`
38- `CharactersHex2`
39
40## Line Stroke and Margins
41
42The stroke and marign around the characters can be adjusted.
43
44```js
45characters.stroke = 16;
46characters.margin.top = 2;
47characters.margin.right = 4;
48characters.margin.left = 6;
49characters.margin.bottom = 8;
50```
51
52# SVG Options
53
54The SVG code can be customized.
55
56```js
57svg.header = '<?xml version="1.0" encoding="UTF-8"?>\n';
58svg.svgAttrs['xmlns:svg'] = 'http://www.w3.org/2000/svg';
59svg.pathAttrs.stroke = '#808080';
60svg.prepend = '<g>';
61svg.append = '</g>';
62```
63
64
65# Bugs
66
67If you find a bug or have compatibility issues, please open a ticket under issues section for this repository.
68
69
70# License
71
72Copyright (c) 2021 JrMasterModelBuilder
73
74Licensed under the Mozilla Public License, v. 2.0.
75
76If this license does not work for you, feel free to contact me.