zenilib: zenilib/jni/external/freetype2/src/base/ftgasp.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ftgasp.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftgasp.c */
4 /* */
5 /* Access of TrueType's `gasp' table (body). */
6 /* */
7 /* Copyright 2007 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */
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. */
15 /* */
16 /***************************************************************************/
17
18
19 #include <ft2build.h>
20 #include FT_GASP_H
21 #include FT_INTERNAL_TRUETYPE_TYPES_H
22
23
24 FT_EXPORT_DEF( FT_Int )
25 FT_Get_Gasp( FT_Face face,
26 FT_UInt ppem )
27 {
28 FT_Int result = FT_GASP_NO_TABLE;
29
30
31 if ( face && FT_IS_SFNT( face ) )
32 {
33 TT_Face ttface = (TT_Face)face;
34
35
36 if ( ttface->gasp.numRanges > 0 )
37 {
38 TT_GaspRange range = ttface->gasp.gaspRanges;
39 TT_GaspRange range_end = range + ttface->gasp.numRanges;
40
41
42 while ( ppem > range->maxPPEM )
43 {
44 range++;
45 if ( range >= range_end )
46 goto Exit;
47 }
48
49 result = range->gaspFlag;
50
51 /* ensure that we don't have spurious bits */
52 if ( ttface->gasp.version == 0 )
53 result &= 3;
54 }
55 }
56 Exit:
57 return result;
58 }
59
60
61 /* END */
FT_Int
signed int FT_Int
Definition: fttypes.h:216
range
GLenum GLint * range
Definition: glew.h:3391
FT_GASP_NO_TABLE
#define FT_GASP_NO_TABLE
Definition: ftgasp.h:92
result
GLuint64EXT * result
Definition: glew.h:12708
TT_Face
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:951
FT_FaceRec_
Definition: freetype.h:912
face
GLenum face
Definition: gl2ext.h:1490
FT_IS_SFNT
#define FT_IS_SFNT(face)
Definition: freetype.h:1160
TT_FaceRec_::gasp
TT_GaspRec gasp
Definition: tttypes.h:1317
ft2build.h
TT_Gasp_::version
FT_UShort version
Definition: tttypes.h:307
FT_EXPORT_DEF
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:511
FT_UInt
unsigned int FT_UInt
Definition: fttypes.h:227
TT_GaspRangeRec_
Definition: tttypes.h:277
TT_Gasp_::numRanges
FT_UShort numRanges
Definition: tttypes.h:308
FT_Get_Gasp
FT_Get_Gasp(FT_Face face, FT_UInt ppem)
Definition: ftgasp.c:25
TT_FaceRec_
Definition: tttypes.h:1258
TT_Gasp_::gaspRanges
TT_GaspRange gaspRanges
Definition: tttypes.h:309
TT_GaspRangeRec_::maxPPEM
FT_UShort maxPPEM
Definition: tttypes.h:279
TT_GaspRangeRec_::gaspFlag
FT_UShort gaspFlag
Definition: tttypes.h:280