aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md22
1 files changed, 21 insertions, 1 deletions
diff --git a/README.md b/README.md
index e6ee3ab..dc9225e 100644
--- a/README.md
+++ b/README.md
@@ -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