{"action":"closed","issue":{"url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1152","repository_url":"https://api.github.com/repos/harfbuzz/harfbuzz","labels_url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1152/labels{/name}","comments_url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1152/comments","events_url":"https://api.github.com/repos/harfbuzz/harfbuzz/issues/1152/events","html_url":"https://github.com/harfbuzz/harfbuzz/issues/1152","id":357925293,"node_id":"MDU6SXNzdWUzNTc5MjUyOTM=","number":1152,"title":"dist/kern and cursive attachment","user":{"login":"punchcutter","id":11257204,"node_id":"MDQ6VXNlcjExMjU3MjA0","avatar_url":"https://avatars1.githubusercontent.com/u/11257204?v=4","gravatar_id":"","url":"https://api.github.com/users/punchcutter","html_url":"https://github.com/punchcutter","followers_url":"https://api.github.com/users/punchcutter/followers","following_url":"https://api.github.com/users/punchcutter/following{/other_user}","gists_url":"https://api.github.com/users/punchcutter/gists{/gist_id}","starred_url":"https://api.github.com/users/punchcutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/punchcutter/subscriptions","organizations_url":"https://api.github.com/users/punchcutter/orgs","repos_url":"https://api.github.com/users/punchcutter/repos","events_url":"https://api.github.com/users/punchcutter/events{/privacy}","received_events_url":"https://api.github.com/users/punchcutter/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-07T05:32:40Z","updated_at":"2018-09-07T17:43:26Z","closed_at":"2018-09-07T17:43:26Z","author_association":"NONE","body":"For Noto Music we have cursive attachment to join parts like shown here: https://github.com/harfbuzz/harfbuzz/issues/1103\r\n\r\nCursive attachment works in these situations, but if we try to apply dist or kern the x advance on the first glyph gets reset by the cursive attachment. \r\n\r\nFrom hb-ot-layout-gpos-table.hh the current code is \r\n\r\n```\r\n    switch (c->direction) {\r\n      case HB_DIRECTION_LTR:\r\n\tpos[i].x_advance = round (exit_x) + pos[i].x_offset;\r\n\td = round (entry_x) + pos[j].x_offset;\r\n\tpos[j].x_advance -= d;\r\n\tpos[j].x_offset  -= d;\r\n\tbreak;\r\n```\r\nThis resets the x_advance on the first glyph which could have been increased with dist or kern before applying cursive attachment. In this case we add width to allow for following dots that are attached on the right with mark to base. Since the x_advance is reset we get overlapping. \r\n![music_dist_bad](https://user-images.githubusercontent.com/11257204/45200057-e166a480-b223-11e8-8dff-27cfae3e3e09.png)\r\nAnd my quick hack to make it work as we expect\r\n\r\n```\r\n    switch (c->direction) {\r\n      case HB_DIRECTION_LTR:\r\n        unsigned int z;\r\n        unsigned int q;\r\n\tz = round (exit_x) + pos[i].x_offset;\r\n\tif (pos[i].x_advance > z) {\r\n\t  q = pos[i].x_advance - z;\r\n\t};\r\n\r\n\td = round (entry_x) + pos[j].x_offset;\r\n\tq += d;\r\n\tpos[j].x_advance -= d;\r\n\tpos[j].x_offset  -= q;\r\n\tbreak;\r\n\r\n```\r\n\r\n![music_dist_good](https://user-images.githubusercontent.com/11257204/45199838-afa10e00-b222-11e8-8d9e-7895f23d546c.png)\r\n\r\nWith this change one test fails, but that one looks off to me in the first place. It's the Noto Newa test in use.tests (last one in there). Before looking at that any further, though, what do you think about all this @behdad ?\r\n"}}
{"actor":{"display_login":"punchcutter"}}