├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── babel.config.js
├── package-lock.json
├── package.json
├── public
├── favicon.ico
└── index.html
├── renovate.json
├── src
├── App.vue
├── lib
│ └── svgFontRenderer.js
├── main.js
└── plugins
│ └── vuetify.js
└── vue.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "node"
4 |
5 | cache: npm
6 |
7 | script: npm run build
8 |
9 | deploy:
10 | provider: pages
11 | skip_cleanup: true
12 | github_token: $GITHUB_TOKEN
13 | local_dir: dist
14 | on:
15 | branch: master
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Jeremias Volker
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Single-Line Font Renderer
2 |
3 | ## Text renderer for CNC machines
4 |
5 | This web based tool renders and exports text (currently from SVG format) intended for CNC machines like pen plotters or laser engravers.
6 |
7 | These machines require a different single-line font type than the more commonly used outline fonts (eg. TTF/OTF) which are mainly intended for screens and printing. More on this topic in this [article](https://www.evilmadscientist.com/2011/hershey-text-an-inkscape-extension-for-engraving-fonts/).
8 |
9 | This tool is an attempt to create a browser based alternative to the excellent [Hershey Text Extension for Inkscape](https://wiki.evilmadscientist.com/Hershey_Text) by Evil Mad Scientist. It has a simplified interface and doesn't require installation. On the downside, this tools feature set is currently more limited.
10 |
11 | [**>> CHECK IT OUT HERE <<**](https://jvolker.github.io/single-line-font-renderer/)
12 |
13 |
14 |
15 | **Features:**
16 | - latest fonts from the [SVG fonts repository](https://gitlab.com/oskay/svg-fonts) are loaded by default
17 | - loads local SVG font files optionally
18 | - adjust font scale and stroke width
19 | - smoothing/simplification (this is experimental: the results from Inkscape are better in some cases)
20 | - export as SVG file
21 |
22 | **Ideas for furture features:**
23 | - [ ] line breaks
24 | - [ ] Use meaningful units: eg. font size and stroke width in mm
25 | - [ ] support for otf/ttf files (eg. using https://github.com/opentypejs/opentype.js): some single-line fonts are set in these types and hard to use in other software
26 | - [ ] DXF export (eg. using https://github.com/microsoft/maker.js/issues/480 or https://github.com/jscad/io/tree/master/packages/svg-deserializer and https://github.com/jscad/io/tree/master/packages/dxf-serializer)
27 | - [ ] move svg font renderer into separate repo with Node.js support and NPM release
28 | - [ ] text area: words wrap to new line when longer than a certain length
29 | - [ ] alignment: right and center
30 |
31 | ## Export and usage
32 |
33 | There are many different tools and ways to use this with CNC machines depending on the machine and use-case. Single-line font renderer was built with the following workflow in mind:
34 |
35 | 1. This tool exports SVGs to be used and rearranged in a vector/graphic design software like [Affinity Designer](https://affinity.serif.com/en-gb/designer/), Adobe Illustrator or others.
36 | 2. The results can then, for example, be used on an [Axidraw pen plotter](https://axidraw.com/) using [saxi](https://github.com/nornagon/saxi/), a web based control software for Axidraw plotters.
37 |
38 |
39 | ## Fonts
40 |
41 | This tool makes use of SVG fonts. This format has advantages over the original Hershey font format as explained in this [article](https://www.evilmadscientist.com/2019/hershey-text-v30/). The fonts are sourced from a [repositiory with SVG fonts](https://gitlab.com/oskay/svg-fonts) maintained by Evil Mad Scientist. It contains updated Hershey and other fonts converted and shared by a variety of people. Lots of them include more glyphs and therefore better language support than the original fonts.
42 |
43 | This tool uses the latest fonts straight from that repository. Please contribute to that repository to improve the variety of fonts and their language support.
44 |
45 | **Font licenses:** Before using any of the fonts, please make sure to check their license contained in that repository.
46 |
47 | ## Acknowledgement
48 |
49 | The rendering core is heavily borrowed from: https://github.com/techninja/hersheytextjs
50 | Thanks to [Evil Mad Scientist](https://www.evilmadscientist.com/) for their pioneering work in this field.
51 |
52 | ## Alternatives to this tool
53 | - [Hershey Text Extension for Inkscape](https://wiki.evilmadscientist.com/Hershey_Text) by Evil Mad Scientist
54 | - [CNC Text Tool](https://msurguy.github.io/cnc-text-tool/)
55 | - [True single-stroke-font text creator](https://www.templatemaker.nl/singlelinetext/)
56 |
57 | ## Development
58 |
59 | ### Project setup
60 | ```
61 | npm install
62 | ```
63 |
64 | ### Compiles and hot-reloads for development
65 | ```
66 | npm run serve
67 | ```
68 |
69 | ### Compiles and minifies for production
70 | ```
71 | npm run build
72 | ```
73 |
74 | ### Lints and fixes files
75 | ```
76 | npm run lint
77 | ```
78 |
79 | ### Customize configuration
80 | See [Configuration Reference](https://cli.vuejs.org/config/).
81 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "single-line-font-renderer",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "npm run serve",
7 | "serve": "vue-cli-service serve",
8 | "build": "vue-cli-service build",
9 | "lint": "vue-cli-service lint"
10 | },
11 | "dependencies": {
12 | "axios": "0.21.1",
13 | "axios-cache-adapter": "2.5.0",
14 | "cheerio": "1.0.0-rc.5",
15 | "core-js": "3.8.3",
16 | "paper": "0.12.11",
17 | "vue": "2.6.12",
18 | "vuetify": "2.4.3"
19 | },
20 | "devDependencies": {
21 | "@vue/cli-plugin-babel": "4.5.11",
22 | "@vue/cli-plugin-eslint": "4.5.11",
23 | "@vue/cli-service": "4.5.11",
24 | "babel-eslint": "10.1.0",
25 | "eslint": "7.18.0",
26 | "eslint-plugin-vue": "7.5.0",
27 | "sass": "1.32.5",
28 | "sass-loader": "10.1.1",
29 | "vue-cli-plugin-vuetify": "2.0.9",
30 | "vue-template-compiler": "2.6.12",
31 | "vuetify-loader": "1.6.0"
32 | },
33 | "eslintConfig": {
34 | "root": true,
35 | "env": {
36 | "node": true
37 | },
38 | "extends": [
39 | "plugin:vue/essential",
40 | "eslint:recommended"
41 | ],
42 | "parserOptions": {
43 | "parser": "babel-eslint"
44 | },
45 | "rules": {
46 | "no-unused-vars": "warn"
47 | }
48 | },
49 | "browserslist": [
50 | "> 1%",
51 | "last 2 versions",
52 | "not dead"
53 | ]
54 | }
55 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jvolker/single-line-font-renderer/26a206672dd19dfc4ae2b1b0259183c1eda37700/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |