summaryrefslogtreecommitdiffstats
path: root/libass/ass.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-05 00:55:13 +0200
committerwm4 <wm4@nowhere>2014-06-05 01:15:14 +0200
commitdcecb9cba3ab2e9c1d082c9860aecb9e437e40f6 (patch)
treec366e02227a4814504f7911d0f6e2d48f5ec0ff4 /libass/ass.h
parent4a4e464d1dadce90bc91dce5448890e987019d89 (diff)
downloadlibass-dcecb9cba3ab2e9c1d082c9860aecb9e437e40f6.tar.bz2
libass-dcecb9cba3ab2e9c1d082c9860aecb9e437e40f6.tar.xz
Add a mechanism for selective style overrides
This adds 2 new API functions: ass_set_selective_style_override() ass_set_selective_style_override_enabled() They can be used to force dialog text to use a specific ASS_Style. It uses a fuzzy heuristic for that, and the quality of results may vary. It does style overriding selectively and tries not to override things that need explicit styling. The heuristic for that isn't set in stone either, and can change with future libass versions. Closes libass#88.
Diffstat (limited to 'libass/ass.h')
-rw-r--r--libass/ass.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/libass/ass.h b/libass/ass.h
index b797a97..408bdeb 100644
--- a/libass/ass.h
+++ b/libass/ass.h
@@ -23,7 +23,7 @@
#include <stdarg.h>
#include "ass_types.h"
-#define LIBASS_VERSION 0x01102001
+#define LIBASS_VERSION 0x01103000
/*
* A linked list of images produced by an ass renderer.
@@ -320,6 +320,32 @@ void ass_set_fonts(ASS_Renderer *priv, const char *default_font,
int update);
/**
+ * \brief Set selective style override mode.
+ * If enabled, the renderer attempts to override the ASS script's styling of
+ * normal subtitles, without affecting explicitly positioned text. If an event
+ * looks like a normal subtitle, parts of the font style are copied from the
+ * user style set with ass_set_selective_style_override().
+ * Warning: the heuristic used for deciding when to override the style is rather
+ * rough, and enabling this option can lead to incorrectly rendered
+ * subtitles. Since the ASS format doesn't have any support for
+ * allowing end-users to customize subtitle styling, this feature can
+ * only be implemented on "best effort" basis, and has to rely on
+ * heuristics that can easily break.
+ * \param priv renderer handle
+ * \param enable enable selective styling if the value is not 0
+ */
+void ass_set_selective_style_override_enabled(ASS_Renderer *priv, int enable);
+
+/**
+ * \brief Set style for selective style override.
+ * See ass_set_selective_style_override_enabled().
+ * \param style style settings to use if override is enabled. Applications
+ * should initialize it with {0} before setting fields. Strings will be copied
+ * by the function.
+ */
+void ass_set_selective_style_override(ASS_Renderer *priv, ASS_Style *style);
+
+/**
* \brief Update/build font cache. This needs to be called if it was
* disabled when ass_set_fonts was set.
*