Commit 0d38084b authored by Rafaël Carré's avatar Rafaël Carré

freetype: use [.\/_] to break lines when ' ' only failed

parent b37f567e
...@@ -1264,11 +1264,22 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -1264,11 +1264,22 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
if( p_prev ) p_prev->p_next = p_line; if( p_prev ) p_prev->p_next = p_line;
else p_lines = p_line; else p_lines = p_line;
uint32_t *psz_unicode_saved = psz_unicode;
while( psz_unicode > psz_line_start && *psz_unicode != ' ' ) while( psz_unicode > psz_line_start && *psz_unicode != ' ' )
{ {
psz_unicode--; psz_unicode--;
} }
if( psz_unicode == psz_line_start ) if( psz_unicode == psz_line_start )
{ /* try harder to break that line */
psz_unicode = psz_unicode_saved;
while( psz_unicode > psz_line_start &&
*psz_unicode != '_' && *psz_unicode != '/' &&
*psz_unicode != '\\' && *psz_unicode != '.' )
{
psz_unicode--;
}
}
if( psz_unicode == psz_line_start )
{ {
msg_Warn( p_filter, "unbreakable string" ); msg_Warn( p_filter, "unbreakable string" );
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment