diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c | 80 |
1 files changed, 25 insertions, 55 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c index 35d3d6c78ff..78910247900 100644 --- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c +++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfobjs.c @@ -4,7 +4,7 @@ * * SFNT object management (base). * - * Copyright (C) 1996-2022 by + * Copyright (C) 1996-2021 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -566,7 +566,7 @@ face_index = FT_ABS( face_instance_index ) & 0xFFFF; /* value -(N+1) requests information on index N */ - if ( face_instance_index < 0 && face_index > 0 ) + if ( face_instance_index < 0 ) face_index--; if ( face_index >= face->ttc_header.count ) @@ -784,23 +784,17 @@ FT_Int num_params, FT_Parameter* params ) { - FT_Error error; + FT_Error error; #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - FT_Error psnames_error; + FT_Error psnames_error; #endif - - FT_Bool has_outline; - FT_Bool is_apple_sbit; - - FT_Bool has_CBLC; - FT_Bool has_CBDT; - FT_Bool has_EBLC; - FT_Bool has_bloc; - FT_Bool has_sbix; - - FT_Bool ignore_typographic_family = FALSE; - FT_Bool ignore_typographic_subfamily = FALSE; - FT_Bool ignore_sbix = FALSE; + FT_Bool has_outline; + FT_Bool is_apple_sbit; + FT_Bool is_apple_sbix; + FT_Bool has_CBLC; + FT_Bool has_CBDT; + FT_Bool ignore_typographic_family = FALSE; + FT_Bool ignore_typographic_subfamily = FALSE; SFNT_Service sfnt = (SFNT_Service)face->sfnt; @@ -819,8 +813,6 @@ ignore_typographic_family = TRUE; else if ( params[i].tag == FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY ) ignore_typographic_subfamily = TRUE; - else if ( params[i].tag == FT_PARAM_TAG_IGNORE_SBIX ) - ignore_sbix = TRUE; } } @@ -856,17 +848,14 @@ tt_face_lookup_table( face, TTAG_CFF2 ) ); #endif - /* check which sbit formats are present */ - has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 ); - has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 ); - has_EBLC = !face->goto_table( face, TTAG_EBLC, stream, 0 ); - has_bloc = !face->goto_table( face, TTAG_bloc, stream, 0 ); - has_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 ); - - is_apple_sbit = FALSE; + is_apple_sbit = 0; + is_apple_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 ); - if ( ignore_sbix ) - has_sbix = FALSE; + /* Apple 'sbix' color bitmaps are rendered scaled and then the 'glyf' + * outline rendered on top. We don't support that yet, so just ignore + * the 'glyf' outline and advertise it as a bitmap-only font. */ + if ( is_apple_sbix ) + has_outline = FALSE; /* if this font doesn't contain outlines, we try to load */ /* a `bhed' table */ @@ -878,13 +867,16 @@ /* load the font header (`head' table) if this isn't an Apple */ /* sbit font file */ - if ( !is_apple_sbit || has_sbix ) + if ( !is_apple_sbit || is_apple_sbix ) { LOAD_( head ); if ( error ) goto Exit; } + has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 ); + has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 ); + /* Ignore outlines for CBLC/CBDT fonts. */ if ( has_CBLC || has_CBDT ) has_outline = FALSE; @@ -994,11 +986,7 @@ /* the optional tables */ /* embedded bitmap support */ - /* TODO: Replace this clumsy check for all possible sbit tables */ - /* with something better (for example, by passing a parameter */ - /* to suppress 'sbix' loading). */ - if ( sfnt->load_eblc && - ( has_CBLC || has_EBLC || has_bloc || has_sbix ) ) + if ( sfnt->load_eblc ) LOAD_( eblc ); /* colored glyph support */ @@ -1008,10 +996,6 @@ LOAD_( colr ); } - /* OpenType-SVG glyph support */ - if ( sfnt->load_svg ) - LOAD_( svg ); - /* consider the pclt, kerning, and gasp tables as optional */ LOAD_( pclt ); LOAD_( gasp ); @@ -1070,14 +1054,7 @@ flags |= FT_FACE_FLAG_COLOR; /* color glyphs */ if ( has_outline == TRUE ) - { - /* by default (and for backward compatibility) we handle */ - /* fonts with an 'sbix' table as bitmap-only */ - if ( has_sbix ) - flags |= FT_FACE_FLAG_SBIX; /* with 'sbix' bitmaps */ - else - flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */ - } + flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */ /* The sfnt driver only supports bitmap fonts natively, thus we */ /* don't set FT_FACE_FLAG_HINTER. */ @@ -1300,8 +1277,7 @@ * * Set up metrics. */ - if ( FT_IS_SCALABLE( root ) || - FT_HAS_SBIX( root ) ) + if ( FT_IS_SCALABLE( root ) ) { /* XXX What about if outline header is missing */ /* (e.g. sfnt wrapped bitmap)? */ @@ -1440,12 +1416,6 @@ sfnt->free_cpal( face ); sfnt->free_colr( face ); } - -#ifdef FT_CONFIG_OPTION_SVG - /* free SVG data */ - if ( sfnt->free_svg ) - sfnt->free_svg( face ); -#endif } #ifdef TT_CONFIG_OPTION_BDF |