Mercurial > mplayer.hg
comparison libass/ass_render.c @ 22968:45c2d7b8c499
Fix a stupid bug in r22473: bbox is zero-filled everytime when a glyph
is found in the cache. This leads to broken karaoke (some glyphs are not
highlighted at all), and, probably, slightly incorrect linebreaks.
author | eugeni |
---|---|
date | Fri, 13 Apr 2007 13:46:49 +0000 |
parents | 07ecf1d8922e |
children | 365eef1fc4f0 |
comparison
equal
deleted
inserted
replaced
22967:25704c80d194 | 22968:45c2d7b8c499 |
---|---|
1264 // not found, get a new outline glyph from face | 1264 // not found, get a new outline glyph from face |
1265 // mp_msg(MSGT_ASS, MSGL_INFO, "miss, index = %d, symbol = %c, adv = (%d, %d)\n", index, symbol, advance->x, advance->y); | 1265 // mp_msg(MSGT_ASS, MSGL_INFO, "miss, index = %d, symbol = %c, adv = (%d, %d)\n", index, symbol, advance->x, advance->y); |
1266 | 1266 |
1267 info->outline_glyph = 0; | 1267 info->outline_glyph = 0; |
1268 info->bm = info->bm_o = info->bm_s = 0; | 1268 info->bm = info->bm_o = info->bm_s = 0; |
1269 info->bbox.xMin = info->bbox.xMax = info->bbox.yMin = info->bbox.yMax = 0; | |
1269 info->advance.x = info->advance.y = 0; | 1270 info->advance.x = info->advance.y = 0; |
1270 | 1271 |
1271 info->glyph = ass_font_get_glyph(frame_context.ass_priv->fontconfig_priv, render_context.font, symbol); | 1272 info->glyph = ass_font_get_glyph(frame_context.ass_priv->fontconfig_priv, render_context.font, symbol); |
1272 if (!info->glyph) | 1273 if (!info->glyph) |
1273 return; | 1274 return; |
1731 pen.y += text_info.glyphs[text_info.length].advance.y; | 1732 pen.y += text_info.glyphs[text_info.length].advance.y; |
1732 | 1733 |
1733 // if it's an outline glyph, we still need to fill the bbox | 1734 // if it's an outline glyph, we still need to fill the bbox |
1734 if (text_info.glyphs[text_info.length].glyph) { | 1735 if (text_info.glyphs[text_info.length].glyph) { |
1735 FT_Glyph_Get_CBox( text_info.glyphs[text_info.length].glyph, FT_GLYPH_BBOX_PIXELS, &(text_info.glyphs[text_info.length].bbox) ); | 1736 FT_Glyph_Get_CBox( text_info.glyphs[text_info.length].glyph, FT_GLYPH_BBOX_PIXELS, &(text_info.glyphs[text_info.length].bbox) ); |
1736 } else { | |
1737 text_info.glyphs[text_info.length].bbox.xMin = 0; | |
1738 text_info.glyphs[text_info.length].bbox.yMin = 0; | |
1739 text_info.glyphs[text_info.length].bbox.xMax = 0; | |
1740 text_info.glyphs[text_info.length].bbox.yMax = 0; | |
1741 } | 1737 } |
1742 | 1738 |
1743 previous = code; | 1739 previous = code; |
1744 | 1740 |
1745 text_info.glyphs[text_info.length].symbol = code; | 1741 text_info.glyphs[text_info.length].symbol = code; |