diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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 |