{"comment":{"created_at":"2011-10-22T06:03:51Z","body":"1.This is my code to draw rectangle on canvas\r\n \r\n        var rect = new fabric.Rect({\r\n                                top: canvasHeight/2,\r\n                                left: canvasWidth/2,\r\n                                width: canvasWidth,\r\n                                height: canvasHeight,\r\n                                //angle: -73,\r\n                                fill: fillColor,\r\n                                  stroke: strokeColor,\r\n                                  //strokeWidth: 2\r\n                                });\r\n        \r\n        canvas.add(rect);\r\n\r\n\r\n 2. To draw text on canvas i want to dynamically change all style so can't use your js font files.\r\n    I have used another library CanvasText, which draws text with style we provide\r\n\r\n     var Canvas = document.getElementById(canvasId);\r\n     var Context = Canvas.getContext('2d');\r\n     var canvasText = new CanvasText;\r\n    \r\n       canvasText.config({\r\n        canvas: Canvas,\r\n        context: Context,\r\n        fontFamily: \"Verdana\",\r\n        fontSize: \"14px\",\r\n        fontWeight: \"normal\",\r\n        fontColor: \"#000\",\r\n        lineHeight: \"22\"\r\n    });\r\n            \r\n    \r\n    canvasText.drawText({\r\n        text:text,\r\n        x: 20,\r\n        y: 30,\r\n        boxWidth:Canvas.width\r\n    });\r\n\r\n3. So now i have shape with text which looks very proper\r\n\r\n4. Now when i click(left click event) on shape it selects shape but wipes out the entire text\r\n\r\n5. What is expected is, it should select all contents(shape+text) on canvas. But its not\r\n\r\n6. So are you drawing anything newly on canvas on selection? (actually no time to go through entire library)\r\n\r\n7. I guess if i comment canvas selection on click event it can solve the problem, what you say?. \r\n   (As far as i know CanvasText is not handling any click events)\r\n","updated_at":"2011-10-22T06:03:51Z","url":"https://api.github.com/repos/kangax/fabric.js/issues/comments/2488581","id":2488581,"user":{"gravatar_id":"9e32e1dc5ff5acd7335244b72bd0ded3","avatar_url":"https://secure.gravatar.com/avatar/9e32e1dc5ff5acd7335244b72bd0ded3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/DeepikaAbbad","id":1104124,"login":"DeepikaAbbad"}},"action":"created","issue":{"number":67,"created_at":"2011-10-19T09:43:22Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi,\r\n\r\nI want to draw text on canvas., how to do it any sample example?\r\nThe canvas already contains some shape drawn, i want to show text on the top of that shape on canvas\r\nHow can i do it?","comments":6,"title":"Draw text on canvas using fabric.js","updated_at":"2011-10-22T06:03:51Z","url":"https://api.github.com/repos/kangax/fabric.js/issues/67","id":1992194,"assignee":null,"milestone":null,"closed_at":"2011-10-19T15:42:46Z","user":{"gravatar_id":"9e32e1dc5ff5acd7335244b72bd0ded3","avatar_url":"https://secure.gravatar.com/avatar/9e32e1dc5ff5acd7335244b72bd0ded3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/DeepikaAbbad","id":1104124,"login":"DeepikaAbbad"},"html_url":"https://github.com/kangax/fabric.js/issues/67","labels":[],"state":"closed"},"legacy":{"issue_id":1992194,"comment_id":2488581}}