From 77cf4f207c59ce4331d3be6331dcbe8656dba29d Mon Sep 17 00:00:00 2001 From: Young-Ho Cha Date: Wed, 21 Mar 2007 10:23:11 +0000 Subject: [PATCH] gst/subparse/samiparse.c: Special-case some more colour names that pango doesn't handle by default. Fixes #420578. Original commit message from CVS: Patch by: Young-Ho Cha * gst/subparse/samiparse.c: (handle_start_font): Special-case some more colour names that pango doesn't handle by default. Fixes #420578. --- ChangeLog | 8 ++++++++ gst/subparse/samiparse.c | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0927d1..a87948f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-03-21 Tim-Philipp Müller + + Patch by: Young-Ho Cha + + * gst/subparse/samiparse.c: (handle_start_font): + Special-case some more colour names that pango doesn't handle by + default. Fixes #420578. + 2007-03-20 Michael Smith * ext/vorbis/vorbisenc.c: (gst_vorbis_enc_chain): diff --git a/gst/subparse/samiparse.c b/gst/subparse/samiparse.c index 39164f7..1485764 100644 --- a/gst/subparse/samiparse.c +++ b/gst/subparse/samiparse.c @@ -175,10 +175,24 @@ handle_start_font (GstSamiContext * sctx, const xmlChar ** atts) sharp = "#"; } } - /* silver colour can be found in many sami files, but X RGB database + /* some colours can be found in many sami files, but X RGB database * doesn't contain a colour by this name, so map explicitly */ - if (!xmlStrncasecmp ((const xmlChar *) "silver", value, 6)) { + if (!xmlStrncasecmp (value, (const xmlChar *) "aqua", len)) { + value = (const xmlChar *) "#00ffff"; + } else if (!xmlStrncasecmp (value, (const xmlChar *) "crimson", len)) { + value = (const xmlChar *) "#dc143c"; + } else if (!xmlStrncasecmp (value, (const xmlChar *) "fuchsia", len)) { + value = (const xmlChar *) "#ff00ff"; + } else if (!xmlStrncasecmp (value, (const xmlChar *) "indigo", len)) { + value = (const xmlChar *) "#4b0082"; + } else if (!xmlStrncasecmp (value, (const xmlChar *) "lime", len)) { + value = (const xmlChar *) "#00ff00"; + } else if (!xmlStrncasecmp (value, (const xmlChar *) "olive", len)) { + value = (const xmlChar *) "#808000"; + } else if (!xmlStrncasecmp (value, (const xmlChar *) "silver", len)) { value = (const xmlChar *) "#c0c0c0"; + } else if (!xmlStrncasecmp (value, (const xmlChar *) "teal", len)) { + value = (const xmlChar *) "#008080"; } g_string_append_printf (sctx->buf, " foreground=\"%s%s\"", sharp, value); -- 2.7.4