{"action":"created","issue":{"url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1484","repository_url":"https://api.github.com/repos/harfbuzz/harfbuzz","labels_url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1484/labels{/name}","comments_url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1484/comments","events_url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1484/events","html_url":"https://github.com/harfbuzz/harfbuzz/pull/1484","id":391520073,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5MDAwMjEz","number":1484,"title":"Remove assumption about Core Text working in 96 DPI","user":{"login":"torarnv","id":7536,"node_id":"MDQ6VXNlcjc1MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/7536?v=4","gravatar_id":"","url":"https://api.github.com/users/torarnv","html_url":"https://github.com/torarnv","followers_url":"https://api.github.com/users/torarnv/followers","following_url":"https://api.github.com/users/torarnv/following{/other_user}","gists_url":"https://api.github.com/users/torarnv/gists{/gist_id}","starred_url":"https://api.github.com/users/torarnv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torarnv/subscriptions","organizations_url":"https://api.github.com/users/torarnv/orgs","repos_url":"https://api.github.com/users/torarnv/repos","events_url":"https://api.github.com/users/torarnv/events{/privacy}","received_events_url":"https://api.github.com/users/torarnv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2018-12-17T00:08:46Z","updated_at":"2018-12-17T11:58:44Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/harfbuzz/harfbuzz/pulls/1484","html_url":"https://github.com/harfbuzz/harfbuzz/pull/1484","diff_url":"https://github.com/harfbuzz/harfbuzz/pull/1484.diff","patch_url":"https://github.com/harfbuzz/harfbuzz/pull/1484.patch"},"body":"Core Text doesn't actually have a concept of DPI internally, as it\r\ndoesn't rasterize anything by itself, it just generates vector paths\r\nthat get passed along to Core Graphics.\r\n\r\nIn practice this means Core Text operates in the classical macOS\r\nlogical DPI of 72, with one typographic point corresponding to one\r\npoint in the Core Graphics coordinate system, which for a normal\r\nbitmap context then corresponds to one pixel -- or two pixels for\r\na \"retina\" context with a 2x scale transform.\r\n\r\nScaling the font point sizes given to HarfBuzz to an assumed DPI\r\nof 96 is problematic with this in mind, as fonts with optical\r\nfeatures such as 'trak' tables for tracking, or color glyphs,\r\nwill then base the metrics off of the wrong point size compared\r\nto what the client asked for.\r\n\r\nThis in turn causes mismatches between the metrics of the shaped\r\ntext and the actual rasterization, which doesn't include the 72\r\nto 96 DPI scaling.\r\n\r\nIf a 96 DPI is needed, such as on the Web, the scaling should be\r\ndone outside of HarfBuzz, allowing the client to keep the DPI of\r\nthe shaping in sync with the rasterization.\r\n\r\nThe recommended way to do that is by scaling the font point size,\r\nnot by applying a transform to the target Core Graphics context,\r\nto let Core Text choose the right optical features of the target\r\npoint size, as described in WWDC 2015 session 804:\r\n\r\n  https://developer.apple.com/videos/play/wwdc2015/804/"},"comment":{"url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/comments/447820387","html_url":"https://github.com/harfbuzz/harfbuzz/pull/1484#issuecomment-447820387","issue_url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1484","id":447820387,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzgyMDM4Nw==","user":{"login":"ebraminio","id":833473,"node_id":"MDQ6VXNlcjgzMzQ3Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/833473?v=4","gravatar_id":"","url":"https://api.github.com/users/ebraminio","html_url":"https://github.com/ebraminio","followers_url":"https://api.github.com/users/ebraminio/followers","following_url":"https://api.github.com/users/ebraminio/following{/other_user}","gists_url":"https://api.github.com/users/ebraminio/gists{/gist_id}","starred_url":"https://api.github.com/users/ebraminio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebraminio/subscriptions","organizations_url":"https://api.github.com/users/ebraminio/orgs","repos_url":"https://api.github.com/users/ebraminio/repos","events_url":"https://api.github.com/users/ebraminio/events{/privacy}","received_events_url":"https://api.github.com/users/ebraminio/received_events","type":"User","site_admin":false},"created_at":"2018-12-17T11:58:44Z","updated_at":"2018-12-17T11:58:44Z","author_association":"MEMBER","body":"And no bugs like these https://www.theverge.com/2015/3/20/8267443/crash-google-chrome-mac-os-x-text and https://www.macobserver.com/tmo/article/apple-core-text-rendering-bug-crashes-apps-in-os-x-and-ios as we can update HarfBuzz just on spotting such issues quickly but one may can't update their OS that quickly so we strongly recommend not using hb-coretext or at least coretext_aat once stabilized, which we can say it is now also as Chrome (not its stable version however) ships it."}}
{"actor":{"display_login":"ebraminio"}}