30 ftc_inode_free( FTC_Node ftcinode,
33 FTC_INode inode = (FTC_INode)ftcinode;
34 FT_Memory memory = cache->memory;
37 FT_Done_Glyph( inode->glyph );
39 FTC_GNode_Done( FTC_GNODE( inode ), cache );
45 FTC_INode_Free( FTC_INode inode,
48 ftc_inode_free( FTC_NODE( inode ), cache );
53 FT_LOCAL_DEF( FT_Error )
54 FTC_INode_New( FTC_INode *pinode,
58 FT_Memory memory = cache->memory;
60 FTC_INode inode = NULL;
63 if ( !FT_QNEW( inode ) )
65 FTC_GNode gnode = FTC_GNODE( inode );
66 FTC_Family family = gquery->family;
67 FT_UInt gindex = gquery->gindex;
68 FTC_IFamilyClass clazz = FTC_CACHE_IFAMILY_CLASS( cache );
72 FTC_GNode_Init( gnode, gindex, family );
76 error = clazz->family_load_glyph( family, gindex, cache,
80 FTC_INode_Free( inode, cache );
90 FT_LOCAL_DEF( FT_Error )
91 ftc_inode_new( FTC_Node *ftcpinode,
95 FTC_INode *pinode = (FTC_INode*)ftcpinode;
96 FTC_GQuery gquery = (FTC_GQuery)ftcgquery;
99 return FTC_INode_New( pinode, gquery, cache );
103 FT_LOCAL_DEF( FT_Offset )
104 ftc_inode_weight( FTC_Node ftcinode,
107 FTC_INode inode = (FTC_INode)ftcinode;
109 FT_Glyph glyph = inode->glyph;
111 FT_UNUSED( ftccache );
114 switch ( glyph->format )
116 case FT_GLYPH_FORMAT_BITMAP:
118 FT_BitmapGlyph bitg = (FT_BitmapGlyph)glyph;
121 size = bitg->bitmap.rows * (FT_Offset)FT_ABS( bitg->bitmap.pitch ) +
126 case FT_GLYPH_FORMAT_OUTLINE:
128 FT_OutlineGlyph outg = (FT_OutlineGlyph)glyph;
131 size = (FT_Offset)outg->outline.n_points *
132 ( sizeof ( FT_Vector ) +
sizeof ( FT_Byte ) ) +
133 (FT_Offset)outg->outline.n_contours * sizeof ( FT_Short ) +
142 size +=
sizeof ( *inode );
149 FT_LOCAL_DEF( FT_Offset )
150 FTC_INode_Weight( FTC_INode inode )
152 return ftc_inode_weight( FTC_NODE( inode ), NULL );