summaryrefslogtreecommitdiffstats
path: root/libass/ass.h
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-07-14 00:38:43 +0300
committerOleg Oshmyan <chortos@inbox.lv>2020-07-14 20:14:44 +0300
commit66dba8dd21bbf81b25b26e2556c404006f80a43c (patch)
tree28080a0ab2a4110e0cfa7bc8a8e909391356b336 /libass/ass.h
parentc1aff3a86e00e99e750057a956f27564120934cb (diff)
downloadlibass-66dba8dd21bbf81b25b26e2556c404006f80a43c.tar.bz2
libass-66dba8dd21bbf81b25b26e2556c404006f80a43c.tar.xz
Disable bidi bracket matching unless enabled via ASS_Feature
Bracket matching is incompatible with VSFilter (even on modern Windows), so disable it by default. But as it's generally a good thing (and 100% more compliant with current Unicode), keep it available as an ASS_Feature. It can be toggled individually or enabled as part of the catch-all ASS_FEATURE_INCOMPATIBLE_EXTENSIONS feature. If libass is compiled against FriBidi older than 1.0, bracket matching is impossible. Signal this at runtime by failing to recognize the ASS_FEATURE_BIDI_BRACKETS feature. This way, clients who want to use bracket matching can set the feature without any compile-time checks for FriBidi and can be freely linked against libass that is itself compiled against any version of FriBidi; and yet they can detect at runtime whether the feature is actually enabled. Fixes https://github.com/libass/libass/issues/374.
Diffstat (limited to 'libass/ass.h')
-rw-r--r--libass/ass.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/libass/ass.h b/libass/ass.h
index 35aeeb7..db67ed2 100644
--- a/libass/ass.h
+++ b/libass/ass.h
@@ -24,7 +24,7 @@
#include <stdarg.h>
#include "ass_types.h"
-#define LIBASS_VERSION 0x01400001
+#define LIBASS_VERSION 0x01400002
#ifdef __cplusplus
extern "C" {
@@ -209,6 +209,19 @@ typedef enum {
*/
ASS_FEATURE_INCOMPATIBLE_EXTENSIONS,
+ /**
+ * Match bracket pairs in bidirectional text according to the revised
+ * Unicode Bidirectional Algorithm introduced in Unicode 6.3.
+ * This is incompatible with VSFilter and disabled by default.
+ *
+ * (Directional isolates, also introduced in Unicode 6.3,
+ * are unconditionally processed when FriBidi is new enough.)
+ *
+ * This feature may be unavailable at runtime (ass_track_set_feature
+ * may return -1) if libass was compiled against old FriBidi.
+ */
+ ASS_FEATURE_BIDI_BRACKETS,
+
// New enum values can be added here in new ABI-compatible library releases.
} ASS_Feature;