Lines Matching full:font
48 static VGboolean del_glyph(struct vg_font *font,
54 cso_hash_take(font->glyphs, (unsigned) glyphIndex);
61 static void add_glyph(struct vg_font *font,
71 del_glyph(font, glyphIndex);
79 cso_hash_insert(font->glyphs, (unsigned) glyphIndex, glyph);
82 static struct vg_glyph *get_glyph(struct vg_font *font,
87 iter = cso_hash_find(font->glyphs, (unsigned) glyphIndex);
135 struct vg_font *font;
137 font = CALLOC_STRUCT(vg_font);
138 vg_init_object(&font->base, ctx, VG_OBJECT_FONT);
139 font->glyphs = cso_hash_create();
141 vg_context_add_object(ctx, &font->base);
143 return font;
146 void font_destroy(struct vg_font *font)
151 vg_context_remove_object(ctx, &font->base);
153 iter = cso_hash_first_node(font->glyphs);
159 cso_hash_delete(font->glyphs);
161 FREE(font);
164 void font_set_glyph_to_path(struct vg_font *font,
171 add_glyph(font, glyphIndex, (struct vg_object *) path,
175 void font_set_glyph_to_image(struct vg_font *font,
181 add_glyph(font, glyphIndex, (struct vg_object *) image,
185 void font_clear_glyph(struct vg_font *font,
188 if (!del_glyph(font, glyphIndex)) {
194 void font_draw_glyph(struct vg_font *font,
202 glyph = get_glyph(font, glyphIndex);
212 void font_draw_glyphs(struct vg_font *font,
224 if (!get_glyph(font, glyphIndices[i])) {
234 glyph = get_glyph(font, glyphIndices[i]);
244 VGint font_num_glyphs(struct vg_font *font)
246 return cso_hash_size(font->glyphs);