1 /****************************************************************************
5 * Access of TrueType's `gasp' table (body).
7 * Copyright (C) 2007-2023 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
10 * This file is part of the FreeType project, and may only be used,
11 * modified, and distributed under the terms of the FreeType project
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
19 #include <freetype/ftgasp.h>
20 #include <freetype/internal/tttypes.h>
23 FT_EXPORT_DEF( FT_Int )
24 FT_Get_Gasp( FT_Face face,
27 FT_Int result = FT_GASP_NO_TABLE;
30 if ( face && FT_IS_SFNT( face ) )
32 TT_Face ttface = (TT_Face)face;
35 if ( ttface->gasp.numRanges > 0 )
37 TT_GaspRange range = ttface->gasp.gaspRanges;
38 TT_GaspRange range_end = range + ttface->gasp.numRanges;
41 while ( ppem > range->maxPPEM )
44 if ( range >= range_end )
48 result = range->gaspFlag;
50 /* ensure that we don't have spurious bits */
51 if ( ttface->gasp.version == 0 )