summaryrefslogtreecommitdiffstats
path: root/libass/ass.c
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2021-03-13 02:20:18 +0100
committerOneric <oneric@oneric.stub>2022-08-19 19:16:33 +0200
commit334e5565c688c0a2a0172c9007e76dffaca238d8 (patch)
tree83e1b55be9269debfc49cfacdba642b16cc714a8 /libass/ass.c
parent169862065a70bedd202bce3c2f92f0e880f70029 (diff)
downloadlibass-334e5565c688c0a2a0172c9007e76dffaca238d8.tar.bz2
libass-334e5565c688c0a2a0172c9007e76dffaca238d8.tar.xz
Add WRAP_UNICODE feature
Setting this feature allows breaking lines according to the Unicode Line Breaking Algorithm and is incompatible with VSFilter. This is useful for non-ASS renderers utilising libass, especially for languages typically not using ASCII-spaces to separate words, but also to correctly break on punctuation even in languages that do. It does not allow breaking words apart, so line overflow might still occur. For this to work a new optional dependency on libunibrak is added. We assume FriBidi's and libunibreak's utf32/glyph type match. This is based on an earlier patch by GitHub user siikamiika.
Diffstat (limited to 'libass/ass.c')
-rw-r--r--libass/ass.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libass/ass.c b/libass/ass.c
index 991d31b..41f72d6 100644
--- a/libass/ass.c
+++ b/libass/ass.c
@@ -1546,6 +1546,9 @@ int ass_track_set_feature(ASS_Track *track, ASS_Feature feature, int enable)
#ifdef USE_FRIBIDI_EX_API
FEATURE_MASK(ASS_FEATURE_BIDI_BRACKETS) |
#endif
+#ifdef CONFIG_UNIBREAK
+ FEATURE_MASK(ASS_FEATURE_WRAP_UNICODE) |
+#endif
FEATURE_MASK(ASS_FEATURE_WHOLE_TEXT_LAYOUT) |
0;
uint32_t requested = 0;