Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update readme with text info

  • Loading branch information...
commit 6dece5175fea20bcd570250617c8b68af4aaaf12 1 parent 966046c
@mojombo authored
Showing with 21 additions and 1 deletion.
  1. +21 −1 README
View
22 README
@@ -88,4 +88,24 @@ square.
square.mouseout(function() {
console.log("out")
- })
+ })
+
+
+BASIC TEXT EXAMPLE
+-----------------------------------------------------------------------------
+
+Primer implements a basic version of Canvas' text api with standard DOM
+elements since no major browser release yet offers this. Let's draw the text
+"Hello, World!" in 12px Monaco in red at (0, 0) with a max width of 100px:
+
+ var text = Primer.Layer()
+ text.font = "12px Monaco"
+ text.fillStyle = "#FF0000"
+ text.textAlign = "center"
+ text.fillText("Hello, World!", 0, 0, 100)
+
+The signature of fillText() is (text, x, y, width). The font attribute takes
+standard CSS font values.
+
+The text API currently does not support any transformations except
+translation.
Please sign in to comment.
Something went wrong with that request. Please try again.