@ -421,32 +421,23 @@
static void
remove_subset_prefix ( FT_String * name )
{
FT_Int32 idx = 0 ;
FT_Int32 length = ( FT_Int32 ) ft_strlen ( name ) + 1 ;
FT_Bool continue_search = 1 ;
FT_UInt32 i = 0 , idx = 0 ;
while ( continue_search )
/* six ASCII uppercase letters followed by a plus sign */
while ( ' A ' < = name [ i ] & & name [ i + + ] < = ' Z ' & &
' A ' < = name [ i ] & & name [ i + + ] < = ' Z ' & &
' A ' < = name [ i ] & & name [ i + + ] < = ' Z ' & &
' A ' < = name [ i ] & & name [ i + + ] < = ' Z ' & &
' A ' < = name [ i ] & & name [ i + + ] < = ' Z ' & &
' A ' < = name [ i ] & & name [ i + + ] < = ' Z ' & &
name [ i + + ] = = ' + ' )
{
if ( length > = 7 & & name [ 6 ] = = ' + ' )
{
for ( idx = 0 ; idx < 6 ; idx + + )
{
/* ASCII uppercase letters */
if ( ! ( ' A ' < = name [ idx ] & & name [ idx ] < = ' Z ' ) )
continue_search = 0 ;
}
if ( continue_search )
{
for ( idx = 7 ; idx < length ; idx + + )
name [ idx - 7 ] = name [ idx ] ;
length - = 7 ;
}
}
else
continue_search = 0 ;
idx = i ;
}
if ( idx )
FT_MEM_MOVE ( name , name + idx , ft_strlen ( name + idx ) + 1 ) ;
}
@ -456,42 +447,20 @@
remove_style ( FT_String * family_name ,
const FT_String * style_name )
{
FT_Int32 family_name_length , style_name_length ;
FT_String * f = family_name + ft_strlen ( family_name ) ;
const FT_String * s = style_name + ft_strlen ( style_name ) ;
family_name_length = ( FT_Int32 ) ft_strlen ( family_name ) ;
style_name_length = ( FT_Int32 ) ft_strlen ( style_name ) ;
/* compare strings moving backwards */
while ( s > style_name )
if ( f = = family_name | | * - - s ! = * - - f )
return ;
if ( family_name_length > style_name_length )
{
FT_Int idx ;
for ( idx = 1 ; idx < = style_name_length ; idx + + )
{
if ( family_name [ family_name_length - idx ] ! =
style_name [ style_name_length - idx ] )
break ;
}
if ( idx > style_name_length )
{
/* family_name ends with style_name; remove it */
idx = family_name_length - style_name_length - 1 ;
/* also remove special characters */
/* between real family name and style */
while ( idx > 0 & &
( family_name [ idx ] = = ' - ' | |
family_name [ idx ] = = ' ' | |
family_name [ idx ] = = ' _ ' | |
family_name [ idx ] = = ' + ' ) )
idx - - ;
if ( idx > 0 )
family_name [ idx + 1 ] = ' \0 ' ;
}
}
/* terminate and remove special characters */
do
* f = ' \0 ' ;
while ( f - - > family_name & &
( * f = = ' - ' | | * f = = ' ' | | * f = = ' _ ' | | * f = = ' + ' ) ) ;
}