diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -1,6 +1,6 @@ # Svg.js -Svg.js is a lightweight (2k gzipped) library for manipulating SVG. +Svg.js is a lightweight (2.5k gzipped) library for manipulating SVG. Svg.js is licensed under the terms of the MIT License. @@ -93,6 +93,26 @@ rect.remove(); ``` +### Text element +Text elements can be created with a single style applied. +```javascript +var text = draw.text({ + text: "svg\nto\nthe\npoint.", + x: 300, + y: 0 +}); +``` +Styling text can be done using the 'font()' method: +```javascript +text.font({ + family: 'Helvetica', + size: 36, + anchor: 'middle', + leading: 1.5 +}); +``` + + ### Image element When creating images the width and height values should be defined: ```javascript |