mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 23:48:53 +00:00
gst/subparse/samiparse.c: Honour font face tags in SAMI subtitles (#344503).
Original commit message from CVS: Patch by: Young-Ho Cha <ganadist at chollian net> * gst/subparse/samiparse.c: (sami_context_pop_state), (handle_start_font), (end_sami_element): Honour font face tags in SAMI subtitles (#344503).
This commit is contained in:
parent
189fd3d76d
commit
8bbf66a57f
2 changed files with 18 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2006-06-12 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
Patch by: Young-Ho Cha <ganadist at chollian net>
|
||||||
|
|
||||||
|
* gst/subparse/samiparse.c: (sami_context_pop_state),
|
||||||
|
(handle_start_font), (end_sami_element):
|
||||||
|
Honour font face tags in SAMI subtitles (#344503).
|
||||||
|
|
||||||
2006-06-11 Stefan Kost <ensonic@users.sf.net>
|
2006-06-11 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* po/POTFILES.in:
|
* po/POTFILES.in:
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define ITALIC_TAG 'i'
|
#define ITALIC_TAG 'i'
|
||||||
#define COLOR_TAG 'c'
|
#define SPAN_TAG 's'
|
||||||
#define RUBY_TAG 'r'
|
#define RUBY_TAG 'r'
|
||||||
#define RT_TAG 't'
|
#define RT_TAG 't'
|
||||||
#define CLEAR_TAG '0'
|
#define CLEAR_TAG '0'
|
||||||
|
@ -79,7 +79,7 @@ sami_context_pop_state (GstSamiContext * sctx, char state)
|
||||||
g_string_append (str, "</i>");
|
g_string_append (str, "</i>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case COLOR_TAG: /* <span foreground= > */
|
case SPAN_TAG: /* <span foreground= > */
|
||||||
{
|
{
|
||||||
g_string_append (str, "</span>");
|
g_string_append (str, "</span>");
|
||||||
break;
|
break;
|
||||||
|
@ -146,8 +146,9 @@ handle_start_font (GstSamiContext * sctx, const xmlChar ** atts)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
sami_context_pop_state (sctx, COLOR_TAG);
|
sami_context_pop_state (sctx, SPAN_TAG);
|
||||||
if (atts != NULL) {
|
if (atts != NULL) {
|
||||||
|
g_string_append (sctx->buf, "<span");
|
||||||
for (i = 0; (atts[i] != NULL); i += 2) {
|
for (i = 0; (atts[i] != NULL); i += 2) {
|
||||||
const xmlChar *key, *value;
|
const xmlChar *key, *value;
|
||||||
|
|
||||||
|
@ -179,11 +180,14 @@ handle_start_font (GstSamiContext * sctx, const xmlChar ** atts)
|
||||||
if (!xmlStrncmp ((const xmlChar *) "silver", value, 6)) {
|
if (!xmlStrncmp ((const xmlChar *) "silver", value, 6)) {
|
||||||
value = (const xmlChar *) "#c0c0c0";
|
value = (const xmlChar *) "#c0c0c0";
|
||||||
}
|
}
|
||||||
g_string_append_printf (sctx->buf, "<span foreground=\"%s%s\">", sharp,
|
g_string_append_printf (sctx->buf, " foreground=\"%s%s\"", sharp,
|
||||||
value);
|
value);
|
||||||
sami_context_push_state (sctx, COLOR_TAG);
|
} else if (!xmlStrncmp ((const xmlChar *) "face", key, 4)) {
|
||||||
|
g_string_append_printf (sctx->buf, " font_family=\"%s\"", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
g_string_append_c (sctx->buf, '>');
|
||||||
|
sami_context_push_state (sctx, SPAN_TAG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +228,7 @@ end_sami_element (void *ctx, const xmlChar * name)
|
||||||
if (!xmlStrncmp ((const xmlChar *) "title", name, 5)) {
|
if (!xmlStrncmp ((const xmlChar *) "title", name, 5)) {
|
||||||
sctx->in_title = FALSE;
|
sctx->in_title = FALSE;
|
||||||
} else if (!xmlStrncmp ((const xmlChar *) "font", name, 4)) {
|
} else if (!xmlStrncmp ((const xmlChar *) "font", name, 4)) {
|
||||||
sami_context_pop_state (sctx, COLOR_TAG);
|
sami_context_pop_state (sctx, SPAN_TAG);
|
||||||
} else if (!xmlStrncmp ((const xmlChar *) "ruby", name, 4)) {
|
} else if (!xmlStrncmp ((const xmlChar *) "ruby", name, 4)) {
|
||||||
sami_context_pop_state (sctx, RUBY_TAG);
|
sami_context_pop_state (sctx, RUBY_TAG);
|
||||||
} else if (!xmlStrncmp ((const xmlChar *) "i", name, 1)) {
|
} else if (!xmlStrncmp ((const xmlChar *) "i", name, 1)) {
|
||||||
|
|
Loading…
Reference in a new issue