{"action":"created","issue":{"url":"https://api.github.com/repos/0xfe/vexflow/issues/226","labels_url":"https://api.github.com/repos/0xfe/vexflow/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/0xfe/vexflow/issues/226/comments","events_url":"https://api.github.com/repos/0xfe/vexflow/issues/226/events","html_url":"https://github.com/0xfe/vexflow/issues/226","id":33459210,"number":226,"title":"Raphael stave text stroke-weight incorrectly set","user":{"login":"drewish","id":68750,"avatar_url":"https://avatars.githubusercontent.com/u/68750?v=3","gravatar_id":"","url":"https://api.github.com/users/drewish","html_url":"https://github.com/drewish","followers_url":"https://api.github.com/users/drewish/followers","following_url":"https://api.github.com/users/drewish/following{/other_user}","gists_url":"https://api.github.com/users/drewish/gists{/gist_id}","starred_url":"https://api.github.com/users/drewish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewish/subscriptions","organizations_url":"https://api.github.com/users/drewish/orgs","repos_url":"https://api.github.com/users/drewish/repos","events_url":"https://api.github.com/users/drewish/events{/privacy}","received_events_url":"https://api.github.com/users/drewish/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-05-14T03:45:56Z","updated_at":"2015-10-14T01:01:25Z","closed_at":"2015-10-14T01:01:25Z","body":"I've modified one of the stave tests to demonstrate the issue:\r\n```js\r\nVex.Flow.Test.Stave.drawStaveText = function(options, contextBuilder) {\r\n  var ctx = new contextBuilder(options.canvas_sel, 900, 140);\r\n  var stave = new Vex.Flow.Stave(300, 10, 200);\r\n  stave.setText(\"Violin\", Vex.Flow.Modifier.Position.LEFT);\r\n  stave.setText(\"Above Text\", Vex.Flow.Modifier.Position.ABOVE);\r\n  stave.setContext(ctx).draw();\r\n\r\n  var notesBar1 = [\r\n    new Vex.Flow.StaveNote({ keys: [\"c/4\"], duration: \"q\" }),\r\n    new Vex.Flow.StaveNote({ keys: [\"d/4\"], duration: \"q\" }),\r\n    new Vex.Flow.StaveNote({ keys: [\"b/4\"], duration: \"qr\" }),\r\n    new Vex.Flow.StaveNote({ keys: [\"c/4\", \"e/4\", \"g/4\"], duration: \"q\" })\r\n  ];\r\n\r\n  // Helper function to justify and draw a 4/4 voice\r\n  Vex.Flow.Formatter.FormatAndDraw(ctx, stave, notesBar1);\r\n\r\n  var stave2 = new Vex.Flow.Stave(500, 10, 100);\r\n  stave2.setText(\"Below Text\", Vex.Flow.Modifier.Position.BELOW);\r\n  stave2.setText(\"Right Text\", Vex.Flow.Modifier.Position.RIGHT);\r\n  stave2.setContext(ctx).draw();\r\n\r\n  ok(true, \"all pass\");\r\n}\r\n```\r\n![screen shot 2014-05-13 at 8 39 19 pm](https://cloud.githubusercontent.com/assets/68750/2966721/6096d89c-db19-11e3-84ea-a1efe31a68dd.png)\r\n\r\nI won't copy the full SVG but here's a comparison of the text before and after drawing the notes:\r\n```html\r\n<text x=\"400\" y=\"15.88888888888889\" text-anchor=\"middle\" font=\"normal 16pt times\" stroke=\"#000000\" fill=\"#000000\" \r\nstroke-width=\"0.3\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-anchor: middle; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16pt; line-height: normal; font-family: times;\">\r\n  <tspan dy=\"6.756076388888889\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\">\r\n    Above Text\r\n  </tspan>\r\n</text>\r\n```\r\n```html\r\n<text x=\"550\" y=\"125.88888888888889\" text-anchor=\"middle\" font=\"normal 16pt times\" stroke=\"#000000\" fill=\"#000000\" \r\nstroke-width=\"1\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-anchor: middle; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16pt; line-height: normal; font-family: times;\">\r\n  <tspan dy=\"6.756076388888886\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\">\r\n    Below Text\r\n  </tspan>\r\n</text>\r\n```\r\nThe key difference is the `stroke-width` goes from 0.3 to 1. \r\n\r\nI believe the problem is in `Vex.Flow.RaphaelContext`:\r\n```\r\n    fillText: function(text, x, y) {\r\n      this.paper.text(x + (this.measureText(text).width / 2),\r\n          (y - (this.state.font_size / (2.25 * this.state.scale.y))), text).\r\n        attr(this.attributes);\r\n      return this;\r\n    }\r\n```\r\nwhere the attributes ends up:\r\n```\r\n{stroke-width: 1, fill: \"black\", stroke: \"black\", font: \"normal 16pt times\"}\r\n```\r\nAnd it seems to be getting it from the stems on the notes."},"comment":{"url":"https://api.github.com/repos/0xfe/vexflow/issues/comments/147895420","html_url":"https://github.com/0xfe/vexflow/issues/226#issuecomment-147895420","issue_url":"https://api.github.com/repos/0xfe/vexflow/issues/226","id":147895420,"user":{"login":"0xfe","id":241299,"avatar_url":"https://avatars.githubusercontent.com/u/241299?v=3","gravatar_id":"","url":"https://api.github.com/users/0xfe","html_url":"https://github.com/0xfe","followers_url":"https://api.github.com/users/0xfe/followers","following_url":"https://api.github.com/users/0xfe/following{/other_user}","gists_url":"https://api.github.com/users/0xfe/gists{/gist_id}","starred_url":"https://api.github.com/users/0xfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xfe/subscriptions","organizations_url":"https://api.github.com/users/0xfe/orgs","repos_url":"https://api.github.com/users/0xfe/repos","events_url":"https://api.github.com/users/0xfe/events{/privacy}","received_events_url":"https://api.github.com/users/0xfe/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T01:01:25Z","updated_at":"2015-10-14T01:01:25Z","body":"This is fixed."}}