{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/10546","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/10546/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/10546/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/10546/events","html_url":"https://github.com/godotengine/godot/pull/10546","id":251971666,"number":10546,"title":"[WIP] Add support for bidi text output","user":{"login":"bruvzg","id":7645683,"avatar_url":"https://avatars0.githubusercontent.com/u/7645683?v=4","gravatar_id":"","url":"https://api.github.com/users/bruvzg","html_url":"https://github.com/bruvzg","followers_url":"https://api.github.com/users/bruvzg/followers","following_url":"https://api.github.com/users/bruvzg/following{/other_user}","gists_url":"https://api.github.com/users/bruvzg/gists{/gist_id}","starred_url":"https://api.github.com/users/bruvzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruvzg/subscriptions","organizations_url":"https://api.github.com/users/bruvzg/orgs","repos_url":"https://api.github.com/users/bruvzg/repos","events_url":"https://api.github.com/users/bruvzg/events{/privacy}","received_events_url":"https://api.github.com/users/bruvzg/received_events","type":"User","site_admin":false},"labels":[{"id":73330068,"url":"https://api.github.com/repos/godotengine/godot/labels/feature%20proposal","name":"feature proposal","color":"1144ff","default":false},{"id":279097966,"url":"https://api.github.com/repos/godotengine/godot/labels/topic:core","name":"topic:core","color":"ffdd44","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/godotengine/godot/milestones/7","html_url":"https://github.com/godotengine/godot/milestone/7","labels_url":"https://api.github.com/repos/godotengine/godot/milestones/7/labels","id":2529217,"number":7,"title":"3.1","description":"","creator":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars0.githubusercontent.com/u/4701338?v=4","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"open_issues":982,"closed_issues":1074,"state":"open","created_at":"2017-05-18T13:33:56Z","updated_at":"2018-05-06T12:28:35Z","due_on":null,"closed_at":null},"comments":73,"created_at":"2017-08-22T14:13:46Z","updated_at":"2018-05-06T13:10:36Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/godotengine/godot/pulls/10546","html_url":"https://github.com/godotengine/godot/pull/10546","diff_url":"https://github.com/godotengine/godot/pull/10546.diff","patch_url":"https://github.com/godotengine/godot/pull/10546.patch"},"body":"This PR uses [ICU](http://site.icu-project.org/) and [HarfBuzz](https://www.freedesktop.org/wiki/Software/HarfBuzz/) libraries, to implement rendering of bi-direction text, complex scripts and OpenType typographic features.\r\n\r\n**Thirdparty libs:**\r\nHarfBuzz (full lib except non-relevant backends and UCDN)\r\nICU4C (\"common\" library, unicode base data and break iterator data)\r\n\r\n**Implements:**\r\n`TextLayout` class to layout paragraph of rich text. Provides bidirectional analysis and reordering, cursor positioning (split cursors for mixed directional text), hit testing, justification, line wrapping.\r\nIt can be used to layout text and embedded objects (images, spans and tables with nested layouts) in a single flow.\r\n`TextLayout` content items `TextLayoutItem*`:\r\n`TextLayoutItemText` - text with attributes.\r\n`TextLayoutItemImage` - embedded image.\r\n`TextLayoutItemSpan` - embedded `TextLayout`.\r\n`TextLayoutItemTable` - simple embedded table with `TextLayout`s.\r\n\r\n`TextLayoutRect` - control that displays `TextLayout`\r\n\r\n`TextHitInfo` - `TextLayout` hit test result, represents a character position, position where new text is inserted into the layout, leading and trailing edges.\r\n\r\n**Changes:**\r\n`Font`/`DynamicFont`: adds methods to provide direct access to font glyphs for `TextLayout` and embedded 167 byte 'font' (![font5_7gf](https://user-images.githubusercontent.com/7645683/32965452-2e5a7c5c-cbdf-11e7-8064-0cc0bebb5543.png)) to do render hex code boxes (![hex](https://user-images.githubusercontent.com/7645683/32965802-6fe7e366-cbe0-11e7-9681-67483dacc79c.png)) in place of missing chars. No breaking changes.\r\n\r\n![editor_demo](https://user-images.githubusercontent.com/7645683/32894439-7cccc084-cae5-11e7-88b7-b65e950e213d.png)\r\n\r\n**Demo project:**\r\n[BidiTest.zip](https://github.com/godotengine/godot/files/1485449/BidiTest.zip)\r\n\r\n### Related:\r\n#3081, #9961, #982"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/386878406","html_url":"https://github.com/godotengine/godot/pull/10546#issuecomment-386878406","issue_url":"https://api.github.com/repos/godotengine/godot/issues/10546","id":386878406,"user":{"login":"reduz","id":6265307,"avatar_url":"https://avatars2.githubusercontent.com/u/6265307?v=4","gravatar_id":"","url":"https://api.github.com/users/reduz","html_url":"https://github.com/reduz","followers_url":"https://api.github.com/users/reduz/followers","following_url":"https://api.github.com/users/reduz/following{/other_user}","gists_url":"https://api.github.com/users/reduz/gists{/gist_id}","starred_url":"https://api.github.com/users/reduz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reduz/subscriptions","organizations_url":"https://api.github.com/users/reduz/orgs","repos_url":"https://api.github.com/users/reduz/repos","events_url":"https://api.github.com/users/reduz/events{/privacy}","received_events_url":"https://api.github.com/users/reduz/received_events","type":"User","site_admin":false},"created_at":"2018-05-06T13:10:36Z","updated_at":"2018-05-06T13:10:36Z","author_association":"OWNER","body":"@bruvzg I was probably not clear, what I suggest implementing in Godot is the basic function to have Arabic work in games, not the full specification. For CJK, as example, they can write vertically and RTL, but in practice no game ever uses this or it's kept to a very minimum so this is not supported by game engines. This is why my suggestion is to **not** use harfbuzz for this and write something custom.\r\n\r\nMaking the text rendering engine way more complex just to fully support the 100% of arabic is not an option to me.\r\n\r\nThe few I understant about rendering arabic, the algorithm does something like this:\r\n\r\n1) Detect which characters are actually arabic and flip order of those (iincluding the LTM/RTM chars)\r\n2) Detect some combinations of them create the proper ligatures. Are ligatures just drawing overlapped characters, or separate characters?\r\n\r\nIf we can implement this ourselves, i think we can still get it to work to a level useful in games, without having to overhaul the whole thing."}}
{"actor":{"display_login":"reduz"}}