summaryrefslogtreecommitdiffstats
path: root/libass/ass.h
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-10-26 00:50:23 +0200
committerOleg Oshmyan <chortos@inbox.lv>2022-02-14 20:43:08 +0200
commitc629be7d70548aea282ea4890c51094055ec66e2 (patch)
tree241292c76a288d30ffc8a4f36a9265c926affa6d /libass/ass.h
parentc4e2aadc88db638eed6090fa81a690235a11d3bd (diff)
downloadlibass-c629be7d70548aea282ea4890c51094055ec66e2.tar.bz2
libass-c629be7d70548aea282ea4890c51094055ec66e2.tar.xz
Run bidi on each glyph run in isolation by default, like VSFilter
Fixes https://code.google.com/archive/p/libass/issues/111. Fixes https://github.com/libass/libass/issues/226 if it was not fixed by commit c93cb3dbfb7357179379ffd19ff973cf062e2129 already. The old ("sane") behavior of running bidi on each event as a whole* can be restored by setting the new ASS_FEATURE_WHOLE_TEXT_LAYOUT. Additionally, in a nod to ASS files and on-the-fly format converters that use libass's nonstandard Encoding -1 for bidi base direction autodetection, make Encoding -1 force WHOLE_TEXT_LAYOUT processing for individual events even when the ASS_Feature is disabled. * Note: we treat explicit line breaks \N as paragraph separators, and effectively bidi is run on each "paragraph" separately. This is standard bidi behavior. Of particular relevance to libass, this is exactly what WebVTT mandates.
Diffstat (limited to 'libass/ass.h')
-rw-r--r--libass/ass.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/libass/ass.h b/libass/ass.h
index 10d5595..ef3ff23 100644
--- a/libass/ass.h
+++ b/libass/ass.h
@@ -238,6 +238,25 @@ typedef enum {
*/
ASS_FEATURE_BIDI_BRACKETS,
+ /**
+ * When this feature is disabled, text is split into VSFilter-compatible
+ * segments and text in each segment is processed in isolation.
+ * Notably, this includes running the Unicode Bidirectional
+ * Algorithm within each run separately.
+ * The individual runs are then laid out left-to-right,
+ * even if they contain right-to-left text.
+ *
+ * When this feature is enabled, each event's text is processed as a whole
+ * (as far as possible). In particular, the Unicode Bidirectional
+ * Algorithm is run on the whole text.
+ *
+ * This is incompatible with VSFilter and disabled by default.
+ *
+ * libass extensions to ASS such as Encoding -1 can cause individual
+ * events to be always processed as if this feature is enabled.
+ */
+ ASS_FEATURE_WHOLE_TEXT_LAYOUT,
+
// New enum values can be added here in new ABI-compatible library releases.
} ASS_Feature;