1 /****************************************************************************
5 * TrueType character mapping table (cmap) support (specification).
7 * Copyright (C) 2002-2020 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.
23 #include <freetype/internal/tttypes.h>
24 #include <freetype/internal/ftvalid.h>
25 #include <freetype/internal/services/svttcmap.h>
30 #define TT_CMAP_FLAG_UNSORTED 1
31 #define TT_CMAP_FLAG_OVERLAPPING 2
33 typedef struct TT_CMapRec_
36 FT_Byte* data; /* pointer to in-memory cmap table */
37 FT_Int flags; /* for format 4 only */
39 } TT_CMapRec, *TT_CMap;
41 typedef const struct TT_CMap_ClassRec_* TT_CMap_Class;
45 (*TT_CMap_ValidateFunc)( FT_Byte* data,
48 typedef struct TT_CMap_ClassRec_
50 FT_CMap_ClassRec clazz;
52 TT_CMap_ValidateFunc validate;
53 TT_CMap_Info_GetFunc get_cmap_info;
58 #define FT_DEFINE_TT_CMAP( class_, \
72 FT_CALLBACK_TABLE_DEF \
73 const TT_CMap_ClassRec class_ = \
94 #define TTCMAPCITEM( a ) FT_CALLBACK_TABLE const TT_CMap_ClassRec a;
98 typedef struct TT_ValidatorRec_
100 FT_ValidatorRec validator;
103 } TT_ValidatorRec, *TT_Validator;
106 #define TT_VALIDATOR( x ) ( (TT_Validator)( x ) )
107 #define TT_VALID_GLYPH_COUNT( x ) TT_VALIDATOR( x )->num_glyphs
110 FT_CALLBACK_TABLE const TT_CMap_ClassRec tt_cmap_unicode_class_rec;
113 tt_face_build_cmaps( TT_Face face );
115 /* used in tt-cmaps service */
117 tt_get_cmap_info( FT_CharMap charmap,
118 TT_CMapInfo *cmap_info );
123 #endif /* TTCMAP_H_ */