aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md20
1 files changed, 19 insertions, 1 deletions
diff --git a/README.md b/README.md
index 57fa85f..60ca2aa 100644
--- a/README.md
+++ b/README.md
@@ -102,8 +102,15 @@ var text = draw.text({
y: 0
});
```
-Styling text can be done using the 'font()' method:
+Styling text can be done using the 'font()' method which is both a setter and a getter:
```javascript
+// get a single font property
+text.font('size');
+
+// set a single font property
+text.font('anchor', 'start');
+
+// set multiple font properties at once
text.font({
family: 'Helvetica',
size: 36,
@@ -115,6 +122,17 @@ Changing text afterwards is also possible with the 'text()' method:
```javascript
text.text('Brilliant!');
```
+To get the raw text content:
+```javascript
+text.content;
+```
+Setting attributes like fill, opacity, x and y is the same as other elements:
+```javascript
+text.attr({
+ fill: '#333',
+ x: 100
+});
+```
### Image element