{"action":"created","comment":{"url":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/comments/53898990","id":53898990,"diff_hunk":"@@ -84,6 +92,31 @@ def generate_fullsize(identity)\n         filename\n       end\n \n+      def generate_svg(identity)\n+        filename = fullsize_path(identity)\n+\n+        svg_bg = %(<rect id=\"bg\" fill=#{to_rgb(identity.color)} x=\"0\" y=\"0\" width=\"240\" height=\"240\"></rect>)\n+        text_paths = Text2Path.convert(identity.letter, svg_font, font_size: 170).to_paths\n+        svg_paths = text_paths.map { |p| svg_path(p) }\n+\n+        raw = <<-SVG\n+<?xml version=\"1.0\" standalone=\"no\"?>\n+<svg width=\"240px\" height=\"240px\" viewBox=\"0 0 240 240\" version=\"1.1\"\n+  xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n+  #{svg_bg}\n+  <svg>\n+    #{svg_paths.join(\"\\n\") }","path":"lib/letter_avatar/avatar.rb","position":63,"original_position":63,"commit_id":"dbcc489ff773bf3fa900d34212b9aff6e74470dd","original_commit_id":"dbcc489ff773bf3fa900d34212b9aff6e74470dd","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Space inside string interpolation detected.","created_at":"2016-02-24T06:22:13Z","updated_at":"2016-02-24T06:22:13Z","html_url":"https://github.com/ksz2k/letter_avatar/pull/8#discussion_r53898990","pull_request_url":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/comments/53898990"},"html":{"href":"https://github.com/ksz2k/letter_avatar/pull/8#discussion_r53898990"},"pull_request":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/8","id":60461236,"html_url":"https://github.com/ksz2k/letter_avatar/pull/8","diff_url":"https://github.com/ksz2k/letter_avatar/pull/8.diff","patch_url":"https://github.com/ksz2k/letter_avatar/pull/8.patch","issue_url":"https://api.github.com/repos/ksz2k/letter_avatar/issues/8","number":8,"state":"open","locked":false,"title":"Support SVG output format","user":{"login":"huacnlee","id":5518,"avatar_url":"https://avatars.githubusercontent.com/u/5518?v=3","gravatar_id":"","url":"https://api.github.com/users/huacnlee","html_url":"https://github.com/huacnlee","followers_url":"https://api.github.com/users/huacnlee/followers","following_url":"https://api.github.com/users/huacnlee/following{/other_user}","gists_url":"https://api.github.com/users/huacnlee/gists{/gist_id}","starred_url":"https://api.github.com/users/huacnlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huacnlee/subscriptions","organizations_url":"https://api.github.com/users/huacnlee/orgs","repos_url":"https://api.github.com/users/huacnlee/repos","events_url":"https://api.github.com/users/huacnlee/events{/privacy}","received_events_url":"https://api.github.com/users/huacnlee/received_events","type":"User","site_admin":false},"body":"@qhwa Would you please help us, is there have way to draw the text align center of the canvas?\r\nDo not merge, incompleted.\r\n\r\n\r\n\r\nM:\r\n\r\n```xml\r\n<?xml version=\"1.0\" standalone=\"no\"?>\r\n<svg width=\"240px\" height=\"240px\" viewBox=\"0 0 240 240\" version=\"1.1\"\r\n  xmlns=\"http://www.w3.org/2000/svg\"\r\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n  <rect id=\"bg\" fill='rgb(254,218,16)' x=\"0\" y=\"0\" width=\"240\" height=\"240\"></rect>\r\n  <svg x=\"39.345703\" y=\"5\">\r\n    <path fill=\"rgba(255, 255, 255, 0.65)\" id=\"letter\" d=\"M39.345703 49.140625 74.125977 142.109375 74.624023 142.109375 109.487305 49.140625 135.634766 49.140625 135.634766 170 115.463867 170 115.463867 128.828125 117.456055 76.450195 116.958008 76.367188 81.098633 170 67.568359 170 31.875 76.616211 31.376953 76.699219 33.369141 128.828125 33.369141 170 13.198242 170 13.198242 49.140625 39.345703 49.140625Z\" />\r\n  </svg>\r\n</svg>\r\n```\r\n\r\nI:\r\n```xml\r\n\r\n<?xml version=\"1.0\" standalone=\"no\"?>\r\n<svg width=\"240px\" height=\"240px\" viewBox=\"0 0 240 240\" version=\"1.1\"\r\n  xmlns=\"http://www.w3.org/2000/svg\"\r\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n  <rect id=\"bg\" fill='rgb(72,182,172)' x=\"0\" y=\"0\" width=\"240\" height=\"240\"></rect>\r\n  <svg x=\"62\" y=\"5\">\r\n    <path fill=\"rgba(255, 255, 255, 0.65)\" id=\"letter\" d=\"M34.53125 170 14.360352 170 14.360352 49.140625 34.53125 49.140625 34.53125 170Z\" />\r\n  </svg>\r\n</svg>\r\n```","created_at":"2016-02-24T06:09:50Z","updated_at":"2016-02-24T06:22:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"997e1b91eea2427c776cc3d5317c3d7a54b29e45","assignee":{"login":"huacnlee","id":5518,"avatar_url":"https://avatars.githubusercontent.com/u/5518?v=3","gravatar_id":"","url":"https://api.github.com/users/huacnlee","html_url":"https://github.com/huacnlee","followers_url":"https://api.github.com/users/huacnlee/followers","following_url":"https://api.github.com/users/huacnlee/following{/other_user}","gists_url":"https://api.github.com/users/huacnlee/gists{/gist_id}","starred_url":"https://api.github.com/users/huacnlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huacnlee/subscriptions","organizations_url":"https://api.github.com/users/huacnlee/orgs","repos_url":"https://api.github.com/users/huacnlee/repos","events_url":"https://api.github.com/users/huacnlee/events{/privacy}","received_events_url":"https://api.github.com/users/huacnlee/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/8/commits","review_comments_url":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/8/comments","review_comment_url":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ksz2k/letter_avatar/issues/8/comments","statuses_url":"https://api.github.com/repos/ksz2k/letter_avatar/statuses/dbcc489ff773bf3fa900d34212b9aff6e74470dd","head":{"label":"ksz2k:feature/svg-format","ref":"feature/svg-format","sha":"dbcc489ff773bf3fa900d34212b9aff6e74470dd","user":{"login":"ksz2k","id":319383,"avatar_url":"https://avatars.githubusercontent.com/u/319383?v=3","gravatar_id":"","url":"https://api.github.com/users/ksz2k","html_url":"https://github.com/ksz2k","followers_url":"https://api.github.com/users/ksz2k/followers","following_url":"https://api.github.com/users/ksz2k/following{/other_user}","gists_url":"https://api.github.com/users/ksz2k/gists{/gist_id}","starred_url":"https://api.github.com/users/ksz2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksz2k/subscriptions","organizations_url":"https://api.github.com/users/ksz2k/orgs","repos_url":"https://api.github.com/users/ksz2k/repos","events_url":"https://api.github.com/users/ksz2k/events{/privacy}","received_events_url":"https://api.github.com/users/ksz2k/received_events","type":"User","site_admin":false},"repo":{"id":23909468,"name":"letter_avatar","full_name":"ksz2k/letter_avatar","owner":{"login":"ksz2k","id":319383,"avatar_url":"https://avatars.githubusercontent.com/u/319383?v=3","gravatar_id":"","url":"https://api.github.com/users/ksz2k","html_url":"https://github.com/ksz2k","followers_url":"https://api.github.com/users/ksz2k/followers","following_url":"https://api.github.com/users/ksz2k/following{/other_user}","gists_url":"https://api.github.com/users/ksz2k/gists{/gist_id}","starred_url":"https://api.github.com/users/ksz2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksz2k/subscriptions","organizations_url":"https://api.github.com/users/ksz2k/orgs","repos_url":"https://api.github.com/users/ksz2k/repos","events_url":"https://api.github.com/users/ksz2k/events{/privacy}","received_events_url":"https://api.github.com/users/ksz2k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ksz2k/letter_avatar","description":"Gem for creating letter avatar from user's name.","fork":false,"url":"https://api.github.com/repos/ksz2k/letter_avatar","forks_url":"https://api.github.com/repos/ksz2k/letter_avatar/forks","keys_url":"https://api.github.com/repos/ksz2k/letter_avatar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ksz2k/letter_avatar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ksz2k/letter_avatar/teams","hooks_url":"https://api.github.com/repos/ksz2k/letter_avatar/hooks","issue_events_url":"https://api.github.com/repos/ksz2k/letter_avatar/issues/events{/number}","events_url":"https://api.github.com/repos/ksz2k/letter_avatar/events","assignees_url":"https://api.github.com/repos/ksz2k/letter_avatar/assignees{/user}","branches_url":"https://api.github.com/repos/ksz2k/letter_avatar/branches{/branch}","tags_url":"https://api.github.com/repos/ksz2k/letter_avatar/tags","blobs_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/refs{/sha}","trees_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ksz2k/letter_avatar/statuses/{sha}","languages_url":"https://api.github.com/repos/ksz2k/letter_avatar/languages","stargazers_url":"https://api.github.com/repos/ksz2k/letter_avatar/stargazers","contributors_url":"https://api.github.com/repos/ksz2k/letter_avatar/contributors","subscribers_url":"https://api.github.com/repos/ksz2k/letter_avatar/subscribers","subscription_url":"https://api.github.com/repos/ksz2k/letter_avatar/subscription","commits_url":"https://api.github.com/repos/ksz2k/letter_avatar/commits{/sha}","git_commits_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/commits{/sha}","comments_url":"https://api.github.com/repos/ksz2k/letter_avatar/comments{/number}","issue_comment_url":"https://api.github.com/repos/ksz2k/letter_avatar/issues/comments{/number}","contents_url":"https://api.github.com/repos/ksz2k/letter_avatar/contents/{+path}","compare_url":"https://api.github.com/repos/ksz2k/letter_avatar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ksz2k/letter_avatar/merges","archive_url":"https://api.github.com/repos/ksz2k/letter_avatar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ksz2k/letter_avatar/downloads","issues_url":"https://api.github.com/repos/ksz2k/letter_avatar/issues{/number}","pulls_url":"https://api.github.com/repos/ksz2k/letter_avatar/pulls{/number}","milestones_url":"https://api.github.com/repos/ksz2k/letter_avatar/milestones{/number}","notifications_url":"https://api.github.com/repos/ksz2k/letter_avatar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ksz2k/letter_avatar/labels{/name}","releases_url":"https://api.github.com/repos/ksz2k/letter_avatar/releases{/id}","deployments_url":"https://api.github.com/repos/ksz2k/letter_avatar/deployments","created_at":"2014-09-11T07:59:14Z","updated_at":"2016-02-23T05:35:13Z","pushed_at":"2016-02-24T06:22:09Z","git_url":"git://github.com/ksz2k/letter_avatar.git","ssh_url":"git@github.com:ksz2k/letter_avatar.git","clone_url":"https://github.com/ksz2k/letter_avatar.git","svn_url":"https://github.com/ksz2k/letter_avatar","homepage":"","size":214,"stargazers_count":77,"watchers_count":77,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":2,"forks":10,"open_issues":2,"watchers":77,"default_branch":"master"}},"base":{"label":"ksz2k:master","ref":"master","sha":"d53e4b1014efebcd5745e4466a5ca58eeb9b298d","user":{"login":"ksz2k","id":319383,"avatar_url":"https://avatars.githubusercontent.com/u/319383?v=3","gravatar_id":"","url":"https://api.github.com/users/ksz2k","html_url":"https://github.com/ksz2k","followers_url":"https://api.github.com/users/ksz2k/followers","following_url":"https://api.github.com/users/ksz2k/following{/other_user}","gists_url":"https://api.github.com/users/ksz2k/gists{/gist_id}","starred_url":"https://api.github.com/users/ksz2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksz2k/subscriptions","organizations_url":"https://api.github.com/users/ksz2k/orgs","repos_url":"https://api.github.com/users/ksz2k/repos","events_url":"https://api.github.com/users/ksz2k/events{/privacy}","received_events_url":"https://api.github.com/users/ksz2k/received_events","type":"User","site_admin":false},"repo":{"id":23909468,"name":"letter_avatar","full_name":"ksz2k/letter_avatar","owner":{"login":"ksz2k","id":319383,"avatar_url":"https://avatars.githubusercontent.com/u/319383?v=3","gravatar_id":"","url":"https://api.github.com/users/ksz2k","html_url":"https://github.com/ksz2k","followers_url":"https://api.github.com/users/ksz2k/followers","following_url":"https://api.github.com/users/ksz2k/following{/other_user}","gists_url":"https://api.github.com/users/ksz2k/gists{/gist_id}","starred_url":"https://api.github.com/users/ksz2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksz2k/subscriptions","organizations_url":"https://api.github.com/users/ksz2k/orgs","repos_url":"https://api.github.com/users/ksz2k/repos","events_url":"https://api.github.com/users/ksz2k/events{/privacy}","received_events_url":"https://api.github.com/users/ksz2k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ksz2k/letter_avatar","description":"Gem for creating letter avatar from user's name.","fork":false,"url":"https://api.github.com/repos/ksz2k/letter_avatar","forks_url":"https://api.github.com/repos/ksz2k/letter_avatar/forks","keys_url":"https://api.github.com/repos/ksz2k/letter_avatar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ksz2k/letter_avatar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ksz2k/letter_avatar/teams","hooks_url":"https://api.github.com/repos/ksz2k/letter_avatar/hooks","issue_events_url":"https://api.github.com/repos/ksz2k/letter_avatar/issues/events{/number}","events_url":"https://api.github.com/repos/ksz2k/letter_avatar/events","assignees_url":"https://api.github.com/repos/ksz2k/letter_avatar/assignees{/user}","branches_url":"https://api.github.com/repos/ksz2k/letter_avatar/branches{/branch}","tags_url":"https://api.github.com/repos/ksz2k/letter_avatar/tags","blobs_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/refs{/sha}","trees_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ksz2k/letter_avatar/statuses/{sha}","languages_url":"https://api.github.com/repos/ksz2k/letter_avatar/languages","stargazers_url":"https://api.github.com/repos/ksz2k/letter_avatar/stargazers","contributors_url":"https://api.github.com/repos/ksz2k/letter_avatar/contributors","subscribers_url":"https://api.github.com/repos/ksz2k/letter_avatar/subscribers","subscription_url":"https://api.github.com/repos/ksz2k/letter_avatar/subscription","commits_url":"https://api.github.com/repos/ksz2k/letter_avatar/commits{/sha}","git_commits_url":"https://api.github.com/repos/ksz2k/letter_avatar/git/commits{/sha}","comments_url":"https://api.github.com/repos/ksz2k/letter_avatar/comments{/number}","issue_comment_url":"https://api.github.com/repos/ksz2k/letter_avatar/issues/comments{/number}","contents_url":"https://api.github.com/repos/ksz2k/letter_avatar/contents/{+path}","compare_url":"https://api.github.com/repos/ksz2k/letter_avatar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ksz2k/letter_avatar/merges","archive_url":"https://api.github.com/repos/ksz2k/letter_avatar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ksz2k/letter_avatar/downloads","issues_url":"https://api.github.com/repos/ksz2k/letter_avatar/issues{/number}","pulls_url":"https://api.github.com/repos/ksz2k/letter_avatar/pulls{/number}","milestones_url":"https://api.github.com/repos/ksz2k/letter_avatar/milestones{/number}","notifications_url":"https://api.github.com/repos/ksz2k/letter_avatar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ksz2k/letter_avatar/labels{/name}","releases_url":"https://api.github.com/repos/ksz2k/letter_avatar/releases{/id}","deployments_url":"https://api.github.com/repos/ksz2k/letter_avatar/deployments","created_at":"2014-09-11T07:59:14Z","updated_at":"2016-02-23T05:35:13Z","pushed_at":"2016-02-24T06:22:09Z","git_url":"git://github.com/ksz2k/letter_avatar.git","ssh_url":"git@github.com:ksz2k/letter_avatar.git","clone_url":"https://github.com/ksz2k/letter_avatar.git","svn_url":"https://github.com/ksz2k/letter_avatar","homepage":"","size":214,"stargazers_count":77,"watchers_count":77,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":2,"forks":10,"open_issues":2,"watchers":77,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/8"},"html":{"href":"https://github.com/ksz2k/letter_avatar/pull/8"},"issue":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/issues/8"},"comments":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/ksz2k/letter_avatar/statuses/dbcc489ff773bf3fa900d34212b9aff6e74470dd"}}}}