{"action":"created","issue":{"url":"https://api.github.com/repos/behdad/harfbuzz/issues/381","repository_url":"https://api.github.com/repos/behdad/harfbuzz","labels_url":"https://api.github.com/repos/behdad/harfbuzz/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/behdad/harfbuzz/issues/381/comments","events_url":"https://api.github.com/repos/behdad/harfbuzz/issues/381/events","html_url":"https://github.com/behdad/harfbuzz/issues/381","id":197447109,"number":381,"title":"Chakma vowel decomposition (1112E and 1112F) not working with USE","user":{"login":"punchcutter","id":11257204,"avatar_url":"https://avatars.githubusercontent.com/u/11257204?v=3","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":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-24T04:06:11Z","updated_at":"2016-12-26T18:59:30Z","closed_at":null,"body":"These vowel signs are getting a dotted circle inserted between them instead of just decomposing. Looking at the shaping code they are decomposed in hb-ot-shape-complex-indic.cc, but Chakma is shaped with USE so shouldn't the decomposition be in hb-ot-shape-complex-use.cc? There are also other decompositions in the indic shaper for scripts shaped by USE:\r\n\r\n```\r\n    case 0x0F77u  : *a = 0x0FB2u; *b= 0x0F81u; return true;  // Tibetan\r\n    case 0x0F79u  : *a = 0x0FB3u; *b= 0x0F81u; return true;  // Tibetan\r\n    case 0x17BEu  : *a = 0x17C1u; *b= 0x17BEu; return true;\r\n    case 0x17BFu  : *a = 0x17C1u; *b= 0x17BFu; return true;\r\n    case 0x17C0u  : *a = 0x17C1u; *b= 0x17C0u; return true;\r\n    case 0x17C4u  : *a = 0x17C1u; *b= 0x17C4u; return true;\r\n    case 0x17C5u  : *a = 0x17C1u; *b= 0x17C5u; return true;\r\n    case 0x1925u  : *a = 0x1920u; *b= 0x1923u; return true;  // Limbu\r\n    case 0x1926u  : *a = 0x1920u; *b= 0x1924u; return true;  // Limbu\r\n    case 0x1B3Cu  : *a = 0x1B42u; *b= 0x1B3Cu; return true;  // Balinese\r\n    case 0x1112Eu  : *a = 0x11127u; *b= 0x11131u; return true;  // Chakma\r\n    case 0x1112Fu  : *a = 0x11127u; *b= 0x11132u; return true;  // Chakma\r\n    case 0x0B57u  : *a = no decomp, -> RIGHT; return true;\r\n    case 0x1C29u  : *a = no decomp, -> LEFT; return true;  // Lepcha\r\n    case 0xA9C0u  : *a = no decomp, -> RIGHT; return true;  // Javanese\r\n    case 0x111BuF  : *a = no decomp, -> ABOVE; return true;\r\n```\r\n\r\nShouldn't these all be in hb-ot-shape-complex-use.cc? To test Chakma I added a decompose function to hb-ot-shape-complex-use.cc and it works as expected:\r\n\r\n```\r\nstatic bool\r\ndecompose_use (const hb_ot_shape_normalize_context_t *c,\r\n\t\t hb_codepoint_t  ab,\r\n\t\t hb_codepoint_t *a,\r\n\t\t hb_codepoint_t *b)\r\n{\r\n  switch (ab)\r\n  {\r\n    case 0x1112Eu  : *a = 0x11127u; *b= 0x11131u; return true;\r\n    case 0x1112Fu  : *a = 0x11127u; *b= 0x11132u; return true;\r\n  }\r\n\r\n\r\n  return (bool) c->unicode->decompose (ab, a, b);\r\n}\r\n\r\nstatic bool\r\ncompose_use (const hb_ot_shape_normalize_context_t *c,\r\n\t     hb_codepoint_t  a,\r\n\t     hb_codepoint_t  b,\r\n\t     hb_codepoint_t *ab)\r\n{\r\n  /* Avoid recomposing split matras. */\r\n  if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (c->unicode->general_category (a)))\r\n    return false;\r\n\r\n  return (bool)c->unicode->compose (a, b, ab);\r\n}\r\n\r\n\r\nconst hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =\r\n{\r\n  \"use\",\r\n  collect_features_use,\r\n  NULL, /* override_features */\r\n  data_create_use,\r\n  data_destroy_use,\r\n  NULL, /* preprocess_text */\r\n  NULL, /* postprocess_glyphs */\r\n  HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,\r\n  decompose_use,\r\n  compose_use,\r\n  setup_masks_use,\r\n  HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,\r\n  false, /* fallback_position */\r\n};\r\n\r\n```\r\nA simple test: 𑄇𑄮\r\nBefore the change 11127 gets a dotted circle. After the change it decomposes properly. This font has other issues, but for this test it seems to work.\r\n[SuzMoriz.ttf.zip](https://github.com/behdad/harfbuzz/files/671643/SuzMoriz.ttf.zip)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/behdad/harfbuzz/issues/comments/269234811","html_url":"https://github.com/behdad/harfbuzz/issues/381#issuecomment-269234811","issue_url":"https://api.github.com/repos/behdad/harfbuzz/issues/381","id":269234811,"user":{"login":"behdad","id":142891,"avatar_url":"https://avatars.githubusercontent.com/u/142891?v=3","gravatar_id":"","url":"https://api.github.com/users/behdad","html_url":"https://github.com/behdad","followers_url":"https://api.github.com/users/behdad/followers","following_url":"https://api.github.com/users/behdad/following{/other_user}","gists_url":"https://api.github.com/users/behdad/gists{/gist_id}","starred_url":"https://api.github.com/users/behdad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behdad/subscriptions","organizations_url":"https://api.github.com/users/behdad/orgs","repos_url":"https://api.github.com/users/behdad/repos","events_url":"https://api.github.com/users/behdad/events{/privacy}","received_events_url":"https://api.github.com/users/behdad/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T18:59:30Z","updated_at":"2016-12-26T18:59:30Z","body":"Ah, ok.  Donno why we missed that before.  At any rate, if they are in Unicode, they get applied in USE.  Perhaps it's not working because we are not prohibiting recompose. See https://github.com/behdad/harfbuzz/issues/382"}}
{"actor":{"display_login":"behdad"}}