1 | # matoran-alphabet
|
2 |
|
3 | Package 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 |
|
17 | Currently supports drawing multiple different character styles as SVG code.
|
18 |
|
19 |
|
20 | # Usage
|
21 |
|
22 | ## Basic Usage
|
23 |
|
24 | ```js
|
25 | import {CharactersRound, SvgEncoder} from 'matoran-alphabet';
|
26 |
|
27 | const characters = new CharactersRound();
|
28 | const svg = new SvgEncoder(characters);
|
29 | console.log(svg.encode('A'));
|
30 | ```
|
31 |
|
32 | ## Characters Styles
|
33 |
|
34 | Multple styles are available.
|
35 |
|
36 | - `CharactersRound`
|
37 | - `CharactersHex1`
|
38 | - `CharactersHex2`
|
39 |
|
40 | ## Line Stroke and Margins
|
41 |
|
42 | The stroke and marign around the characters can be adjusted.
|
43 |
|
44 | ```js
|
45 | characters.stroke = 16;
|
46 | characters.margin.top = 2;
|
47 | characters.margin.right = 4;
|
48 | characters.margin.left = 6;
|
49 | characters.margin.bottom = 8;
|
50 | ```
|
51 |
|
52 | # SVG Options
|
53 |
|
54 | The SVG code can be customized.
|
55 |
|
56 | ```js
|
57 | svg.header = '<?xml version="1.0" encoding="UTF-8"?>\n';
|
58 | svg.svgAttrs['xmlns:svg'] = 'http://www.w3.org/2000/svg';
|
59 | svg.pathAttrs.stroke = '#808080';
|
60 | svg.prepend = '<g>';
|
61 | svg.append = '</g>';
|
62 | ```
|
63 |
|
64 |
|
65 | # Bugs
|
66 |
|
67 | If you find a bug or have compatibility issues, please open a ticket under issues section for this repository.
|
68 |
|
69 |
|
70 | # License
|
71 |
|
72 | Copyright (c) 2021 JrMasterModelBuilder
|
73 |
|
74 | Licensed under the Mozilla Public License, v. 2.0.
|
75 |
|
76 | If this license does not work for you, feel free to contact me.
|