1 /***************************************************************************/
5 /* FreeType Glyph Image (FT_Glyph) cache (body). */
7 /* Copyright 2000-2001 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. */
16 /***************************************************************************/
21 #include FT_CACHE_INTERNAL_GLYPH_H
24 #include FT_INTERNAL_OBJECTS_H
25 #include FT_INTERNAL_DEBUG_H
30 /* create a new chunk node, setting its cache index and ref count */
32 ftc_glyph_node_init( FTC_GlyphNode gnode,
34 FTC_GlyphFamily gfam )
37 FT_UInt start = FTC_GLYPH_FAMILY_START( gfam, gindex );
40 gnode->item_start = (FT_UShort)start;
42 len = gfam->item_total - start;
43 if ( len > gfam->item_count )
44 len = gfam->item_count;
46 gnode->item_count = (FT_UShort)len;
47 gfam->family.num_nodes++;
52 ftc_glyph_node_done( FTC_GlyphNode gnode,
55 /* finalize the node */
56 gnode->item_count = 0;
57 gnode->item_start = 0;
59 ftc_node_done( FTC_NODE( gnode ), cache );
63 FT_EXPORT_DEF( FT_Bool )
64 ftc_glyph_node_compare( FTC_GlyphNode gnode,
65 FTC_GlyphQuery gquery )
67 FT_UInt start = (FT_UInt)gnode->item_start;
68 FT_UInt count = (FT_UInt)gnode->item_count;
70 return FT_BOOL( (FT_UInt)( gquery->gindex - start ) < count );
74 /*************************************************************************/
75 /*************************************************************************/
77 /***** CHUNK SETS *****/
79 /*************************************************************************/
80 /*************************************************************************/
83 FT_EXPORT_DEF( FT_Error )
84 ftc_glyph_family_init( FTC_GlyphFamily gfam,
88 FTC_GlyphQuery gquery,
94 error = ftc_family_init( FTC_FAMILY( gfam ), FTC_QUERY( gquery ), cache );
98 gfam->item_total = item_total;
99 gfam->item_count = item_count;
101 FTC_GLYPH_FAMILY_FOUND( gfam, gquery );
108 FT_EXPORT_DEF( void )
109 ftc_glyph_family_done( FTC_GlyphFamily gfam )
111 ftc_family_done( FTC_FAMILY( gfam ) );