Permalink
Browse files

update readme with text info

  • Loading branch information...
1 parent 966046c commit 6dece5175fea20bcd570250617c8b68af4aaaf12 @mojombo committed Oct 25, 2008
Showing with 21 additions and 1 deletion.
  1. +21 −1 README
View
@@ -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.

0 comments on commit 6dece51

Please sign in to comment.