{"action":"created","issue":{"url":"https://api.github.com/repos/processing/p5.js/issues/1097","repository_url":"https://api.github.com/repos/processing/p5.js","labels_url":"https://api.github.com/repos/processing/p5.js/issues/1097/labels{/name}","comments_url":"https://api.github.com/repos/processing/p5.js/issues/1097/comments","events_url":"https://api.github.com/repos/processing/p5.js/issues/1097/events","html_url":"https://github.com/processing/p5.js/issues/1097","id":116339683,"number":1097,"title":"Can only use custom font on one canvas","user":{"login":"jrc03c","id":255934,"avatar_url":"https://avatars.githubusercontent.com/u/255934?v=3","gravatar_id":"","url":"https://api.github.com/users/jrc03c","html_url":"https://github.com/jrc03c","followers_url":"https://api.github.com/users/jrc03c/followers","following_url":"https://api.github.com/users/jrc03c/following{/other_user}","gists_url":"https://api.github.com/users/jrc03c/gists{/gist_id}","starred_url":"https://api.github.com/users/jrc03c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrc03c/subscriptions","organizations_url":"https://api.github.com/users/jrc03c/orgs","repos_url":"https://api.github.com/users/jrc03c/repos","events_url":"https://api.github.com/users/jrc03c/events{/privacy}","received_events_url":"https://api.github.com/users/jrc03c/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/processing/p5.js/labels/area:typography","name":"area:typography","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-11T13:56:15Z","updated_at":"2016-05-15T13:26:09Z","closed_at":"2015-12-09T12:38:43Z","body":"I'm trying to use a custom font on two different canvases, but when I do, the `canvas2.text()` function only seems to draw stuff to the original canvas. However, if I disable the `canvas2.textFont()` call, the text appears correctly on the second canvas, but *not* rendered in its custom font! (NOTE: I've created the second canvas using `createGraphics()` instead of `createCanvas()`.) Here's the code:\r\n\r\n```\r\nvar myFont;\r\n\r\nfunction preload(){\r\n    myFont = loadFont(\"https://dl.dropboxusercontent.com/u/69679202/roboto.ttf\");\r\n}\r\n\r\nfunction setup(){\r\n    var canvas1 = createCanvas(200, 200);\r\n    background(0);\r\n    fill(255);\r\n    textFont(myFont);\r\n    textSize(32);\r\n    text(\"Hello, world!\", 10, 24);\r\n    \r\n    var canvas2 = createGraphics(200, 200);\r\n    canvas2.style(\"display\", \"block\");\r\n    canvas2.background(255, 0, 0);\r\n    canvas2.fill(0);\r\n    canvas2.textFont(myFont);\r\n    canvas2.textSize(32);\r\n    canvas2.text(\"Goodbye, world!\", 10, 24);\r\n}\r\n```\r\n\r\nAnd here's the result:\r\n\r\n![screen shot 2015-11-11 at 7 55 05 am](https://cloud.githubusercontent.com/assets/255934/11092503/9c120fa2-8849-11e5-8f57-c0f79fa18963.png)\r\n\r\nAm I doing something wrong, or is this a bug? Thanks!"},"comment":{"url":"https://api.github.com/repos/processing/p5.js/issues/comments/219285706","html_url":"https://github.com/processing/p5.js/issues/1097#issuecomment-219285706","issue_url":"https://api.github.com/repos/processing/p5.js/issues/1097","id":219285706,"user":{"login":"dhowe","id":737638,"avatar_url":"https://avatars.githubusercontent.com/u/737638?v=3","gravatar_id":"","url":"https://api.github.com/users/dhowe","html_url":"https://github.com/dhowe","followers_url":"https://api.github.com/users/dhowe/followers","following_url":"https://api.github.com/users/dhowe/following{/other_user}","gists_url":"https://api.github.com/users/dhowe/gists{/gist_id}","starred_url":"https://api.github.com/users/dhowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhowe/subscriptions","organizations_url":"https://api.github.com/users/dhowe/orgs","repos_url":"https://api.github.com/users/dhowe/repos","events_url":"https://api.github.com/users/dhowe/events{/privacy}","received_events_url":"https://api.github.com/users/dhowe/received_events","type":"User","site_admin":false},"created_at":"2016-05-15T13:26:09Z","updated_at":"2016-05-15T13:26:09Z","body":"See also #1413 for a better fix"}}