{"action":"created","issue":{"url":"https://api.github.com/repos/memononen/nanovg/issues/266","repository_url":"https://api.github.com/repos/memononen/nanovg","labels_url":"https://api.github.com/repos/memononen/nanovg/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/memononen/nanovg/issues/266/comments","events_url":"https://api.github.com/repos/memononen/nanovg/issues/266/events","html_url":"https://github.com/memononen/nanovg/issues/266","id":132204799,"number":266,"title":"turning off text pixel-snapping","user":{"login":"wtholliday","id":841144,"avatar_url":"https://avatars.githubusercontent.com/u/841144?v=3","gravatar_id":"","url":"https://api.github.com/users/wtholliday","html_url":"https://github.com/wtholliday","followers_url":"https://api.github.com/users/wtholliday/followers","following_url":"https://api.github.com/users/wtholliday/following{/other_user}","gists_url":"https://api.github.com/users/wtholliday/gists{/gist_id}","starred_url":"https://api.github.com/users/wtholliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wtholliday/subscriptions","organizations_url":"https://api.github.com/users/wtholliday/orgs","repos_url":"https://api.github.com/users/wtholliday/repos","events_url":"https://api.github.com/users/wtholliday/events{/privacy}","received_events_url":"https://api.github.com/users/wtholliday/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-08T17:18:54Z","updated_at":"2016-02-08T20:04:22Z","closed_at":null,"body":"As I understand it, nanovg's font rendering snaps in order to improve anti-aliasing.\r\n\r\nIn my app, the user can zoom in and out, so the text jumps around as it snaps. So I get fairly frequent feedback from users, who think this is a bug.\r\n\r\nSince retina screens have such good resolution, I'd rather just turn off the snapping, but there doesn't seem to be API to do so.\r\n\r\nWhere in nanovg (or fontstash) does the pixel snapping occur and how can I disable it?\r\n\r\nthanks!"},"comment":{"url":"https://api.github.com/repos/memononen/nanovg/issues/comments/181543398","html_url":"https://github.com/memononen/nanovg/issues/266#issuecomment-181543398","issue_url":"https://api.github.com/repos/memononen/nanovg/issues/266","id":181543398,"user":{"login":"memononen","id":5249992,"avatar_url":"https://avatars.githubusercontent.com/u/5249992?v=3","gravatar_id":"","url":"https://api.github.com/users/memononen","html_url":"https://github.com/memononen","followers_url":"https://api.github.com/users/memononen/followers","following_url":"https://api.github.com/users/memononen/following{/other_user}","gists_url":"https://api.github.com/users/memononen/gists{/gist_id}","starred_url":"https://api.github.com/users/memononen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memononen/subscriptions","organizations_url":"https://api.github.com/users/memononen/orgs","repos_url":"https://api.github.com/users/memononen/repos","events_url":"https://api.github.com/users/memononen/events{/privacy}","received_events_url":"https://api.github.com/users/memononen/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T20:04:22Z","updated_at":"2016-02-08T20:04:22Z","body":"Yes, this would be a good feature to have. I don't currently have time to implement it, but I can walk you help you out to make a PR for it.\r\n\r\nThe first thing to to would be to just remove the rounding. It is done here:\r\nhttps://github.com/memononen/nanovg/blob/master/src/fontstash.h#L1134\r\nhttps://github.com/memononen/nanovg/blob/master/src/fontstash.h#L1147\r\n\r\nIt could be controlled by something like this:\r\n```C\r\nvoid fonsSetPixelSnap(FONScontext* s, int state);\r\n```\r\nAnd in nanovg:\r\n```C\r\nvoid nvgTextPixelSnap(NVGcontext* ctx, int state);\r\n```\r\n\r\nThis will lead to blurry text most of the time. In oder to solve that we could improve the font stash to include 2x2 oversampling as per: https://github.com/nothings/stb/tree/master/tests/oversample\r\nI think that would be a better default too than pixel snapping."}}