[Bug 782025] Subtitle are aligned incorrectly for right-to-left languages

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed May 3 18:50:05 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=782025

--- Comment #16 from Nicolas Dufresne (stormer) <nicolas at ndufresne.ca> ---
Ok, more research, this is definatly a question to raise to Pango people, we
cannot do anything about it in Gst. What I understood is that the text is being
itemized. So if I write:

Allo דמבלדור

You read the first item "Allo" not "ollA", and the second item "דמבלדור" and
not "רודלבמד". This is all done internally to Pango, GStreamer really have
nothing to do with it. For windows-1255 (or ISO-8859-8 logical order), what
happens is that it's simply first converted to UTF-8, hence the same results.
Works also if you collate the two words, since for each characters, pango will
decide to itemized base on the Unicode bidirectional algorithm [1].

>From my tests, punctuation is neutral. Which I believe means that it should
inherit from left most item in logical order. And overall items are rendered
left to right. So let's way we have "?ר" (logical order), it should render the
same. But Pango will make the neutral ? inherit from the next character, hence
place the ? at the right. I didn't read the algorithm, so I won't comment about
who's right/wrong. Though, I can show a case which is not possible with the way
VLC handle it. Let's say you want 2 hebrew characters and punctuation before
and after.

  !<c2><c1>?

Logical order would be:

  ?<c1><c2>!

Pango will render it the way you expect, but VLC would render:

  ?!<c2><c2>

And there would be no way to represent what you want.

[1] http://www.unicode.org/reports/tr9/

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list