From d0b1ad983e3d1e868649a88a5133cba778ed396e Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sat, 11 Apr 2009 07:42:48 +0000 Subject: [PATCH] Update libass to r29169 of MPlayer. Originally committed to SVN as r2776. --- aegisub/libass/ass.c | 1 + aegisub/libass/ass_fontconfig.c | 14 +++++++------- aegisub/libass/ass_render.c | 4 ++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/aegisub/libass/ass.c b/aegisub/libass/ass.c index 612c8d6aa..b0c38c2ce 100644 --- a/aegisub/libass/ass.c +++ b/aegisub/libass/ass.c @@ -1128,6 +1128,7 @@ long long ass_step_sub(ass_track_t* track, long long now, int movement) { ass_track_t* ass_new_track(ass_library_t* library) { ass_track_t* track = calloc(1, sizeof(ass_track_t)); track->library = library; + track->ScaledBorderAndShadow = 1; track->parser_priv = calloc(1, sizeof(parser_priv_t)); return track; } diff --git a/aegisub/libass/ass_fontconfig.c b/aegisub/libass/ass_fontconfig.c index cb14b8ef9..854a5ad10 100644 --- a/aegisub/libass/ass_fontconfig.c +++ b/aegisub/libass/ass_fontconfig.c @@ -165,11 +165,13 @@ static char* _select_font(fc_instance_t* priv, const char* family, int treat_fam goto error; #if (FC_VERSION >= 20297) - // Remove all extra family names from original pattern. - // After this, FcFontRenderPrepare will select the most relevant family - // name in case there are more than one of them. - for (; family_cnt > 1; --family_cnt) - FcPatternRemove(pat, FC_FAMILY, family_cnt - 1); + if (!treat_family_as_pattern) { + // Remove all extra family names from original pattern. + // After this, FcFontRenderPrepare will select the most relevant family + // name in case there are more than one of them. + for (; family_cnt > 1; --family_cnt) + FcPatternRemove(pat, FC_FAMILY, family_cnt - 1); + } #endif rpat = FcFontRenderPrepare(priv->config, pat, fset->fonts[curf]); @@ -422,7 +424,6 @@ fc_instance_t* fontconfig_init(ass_library_t* library, FT_Library ftlibrary, con #endif int i; - if (!fc) { mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FontconfigDisabledDefaultFontWillBeUsed); @@ -446,7 +447,6 @@ fc_instance_t* fontconfig_init(ass_library_t* library, FT_Library ftlibrary, con priv->config = FcConfigGetCurrent(); if (!priv->config) { #endif - mp_msg(MSGT_ASS, MSGL_FATAL, MSGTR_LIBASS_FcInitLoadConfigAndFontsFailed); goto exit; } diff --git a/aegisub/libass/ass_render.c b/aegisub/libass/ass_render.c index b561b2a82..b3584948f 100644 --- a/aegisub/libass/ass_render.c +++ b/aegisub/libass/ass_render.c @@ -455,6 +455,7 @@ static void render_overlap(ass_image_t** last_tail, ass_image_t** tail, bitmap_h cur_top = top-by; // Query cache + memset(&hk, 0, sizeof(hk)); memcpy(&hk.a, last_hash, sizeof(*last_hash)); memcpy(&hk.b, hash, sizeof(*hash)); hk.aw = aw; @@ -1429,6 +1430,7 @@ static void get_outline_glyph(int symbol, glyph_info_t* info, FT_Vector* advance int error; glyph_hash_val_t* val; glyph_hash_key_t key; + memset(&key, 0, sizeof(key)); key.font = render_context.font; key.size = render_context.font_size; key.ch = symbol; @@ -1873,6 +1875,7 @@ static void transform_3d(FT_Vector shift, FT_Glyph* glyph, FT_Glyph* glyph2, dou /** * \brief Main ass rendering function, glues everything together * \param event event to render + * \param event_images struct containing resulting images, will also be initialized * Process event, appending resulting ass_image_t's to images_root. */ static int ass_render_event(ass_event_t* event, event_images_t* event_images) @@ -2166,6 +2169,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) for (i = 0; i < text_info.length; ++i) get_bitmap_glyph(text_info.glyphs + i); + memset(event_images, 0, sizeof(*event_images)); event_images->top = device_y - d6_to_int(text_info.lines[0].asc); event_images->height = d6_to_int(text_info.height); event_images->detect_collisions = render_context.detect_collisions;