https://github.com/arhea/brushjs
Provides a single API for drawing Canvas or SVG elements.
https://github.com/arhea/brushjs
Last synced: about 1 year ago
JSON representation
Provides a single API for drawing Canvas or SVG elements.
- Host: GitHub
- URL: https://github.com/arhea/brushjs
- Owner: arhea
- Created: 2011-09-14T02:08:25.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2016-08-11T20:24:10.000Z (almost 10 years ago)
- Last Synced: 2025-04-23T18:04:19.273Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 14
- Watchers: 4
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BrushJS
BrushJS provides a single API for drawing on the canvas as well as writing to SVG.
## Example
```html
Your browser does not support canvas.
```
```javascript
var ctx = new Brush( "#SVG" );
ctx.fillStyle = "#333333";
ctx.font = "20px sans-serif";
ctx.fillText( "Sample Text" , 300 , 300 );
document.getElementById( "xml" ).innerHTML = ctx.toDataURL( "image/svg+xml" );
```