@ -316,7 +316,7 @@
/* Find all blue zones. Flat segments give the reference points, */
/* round segments the overshoot positions. */
static void
static int
af_latin_metrics_init_blues ( AF_LatinMetrics metrics ,
FT_Face face )
{
@ -985,10 +985,11 @@
af_shaper_buf_destroy ( face , shaper_buf ) ;
/* we finally check whether blue zones are ordered; */
/* `ref' and `shoot' values of two blue zones must not overlap */
if ( axis - > blue_count )
{
/* we finally check whether blue zones are ordered; */
/* `ref' and `shoot' values of two blue zones must not overlap */
FT_UInt i ;
AF_LatinBlue blue_sorted [ AF_BLUE_STRINGSET_MAX_LEN + 2 ] ;
@ -1037,11 +1038,34 @@
* a ) ) ;
}
}
FT_TRACE5 ( ( " \n " ) ) ;
return 0 ;
}
else
{
/* disable hinting for the current style if there are no blue zones */
FT_TRACE5 ( ( " \n " ) ) ;
AF_FaceGlobals globals = metrics - > root . globals ;
FT_UShort * gstyles = globals - > glyph_styles ;
FT_Long i ;
FT_TRACE5 ( ( " no blue zones found: "
" hinting disabled for this style \n " ) ) ;
for ( i = 0 ; i < globals - > glyph_count ; i + + )
{
if ( ( gstyles [ i ] & AF_STYLE_MASK ) = = sc - > style )
gstyles [ i ] = AF_STYLE_NONE_DFLT ;
}
FT_TRACE5 ( ( " \n " ) ) ;
return ;
return 1 ;
}
}
@ -1120,6 +1144,8 @@
af_latin_metrics_init ( AF_LatinMetrics metrics ,
FT_Face face )
{
FT_Error error = FT_Err_Ok ;
FT_CharMap oldmap = face - > charmap ;
@ -1128,12 +1154,18 @@
if ( ! FT_Select_Charmap ( face , FT_ENCODING_UNICODE ) )
{
af_latin_metrics_init_widths ( metrics , face ) ;
af_latin_metrics_init_blues ( metrics , face ) ;
if ( af_latin_metrics_init_blues ( metrics , face ) )
{
/* use internal error code to indicate missing blue zones */
error = - 1 ;
goto Exit ;
}
af_latin_metrics_check_digits ( metrics , face ) ;
}
Exit :
FT_Set_Charmap ( face , oldmap ) ;
return FT_Err_Ok ;
return error ;
}