jpayne@69: /* jpayne@69: * Copyright © 2009 Red Hat, Inc. jpayne@69: * jpayne@69: * This is part of HarfBuzz, a text shaping library. jpayne@69: * jpayne@69: * Permission is hereby granted, without written agreement and without jpayne@69: * license or royalty fees, to use, copy, modify, and distribute this jpayne@69: * software and its documentation for any purpose, provided that the jpayne@69: * above copyright notice and the following two paragraphs appear in jpayne@69: * all copies of this software. jpayne@69: * jpayne@69: * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR jpayne@69: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES jpayne@69: * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN jpayne@69: * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH jpayne@69: * DAMAGE. jpayne@69: * jpayne@69: * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, jpayne@69: * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND jpayne@69: * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS jpayne@69: * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO jpayne@69: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. jpayne@69: * jpayne@69: * Red Hat Author(s): Behdad Esfahbod jpayne@69: */ jpayne@69: jpayne@69: #ifndef HB_H_IN jpayne@69: #error "Include instead." jpayne@69: #endif jpayne@69: jpayne@69: #ifndef HB_FACE_H jpayne@69: #define HB_FACE_H jpayne@69: jpayne@69: #include "hb-common.h" jpayne@69: #include "hb-blob.h" jpayne@69: #include "hb-set.h" jpayne@69: jpayne@69: HB_BEGIN_DECLS jpayne@69: jpayne@69: jpayne@69: HB_EXTERN unsigned int jpayne@69: hb_face_count (hb_blob_t *blob); jpayne@69: jpayne@69: jpayne@69: /* jpayne@69: * hb_face_t jpayne@69: */ jpayne@69: jpayne@69: typedef struct hb_face_t hb_face_t; jpayne@69: jpayne@69: HB_EXTERN hb_face_t * jpayne@69: hb_face_create (hb_blob_t *blob, jpayne@69: unsigned int index); jpayne@69: jpayne@69: typedef hb_blob_t * (*hb_reference_table_func_t) (hb_face_t *face, hb_tag_t tag, void *user_data); jpayne@69: jpayne@69: /* calls destroy() when not needing user_data anymore */ jpayne@69: HB_EXTERN hb_face_t * jpayne@69: hb_face_create_for_tables (hb_reference_table_func_t reference_table_func, jpayne@69: void *user_data, jpayne@69: hb_destroy_func_t destroy); jpayne@69: jpayne@69: HB_EXTERN hb_face_t * jpayne@69: hb_face_get_empty (void); jpayne@69: jpayne@69: HB_EXTERN hb_face_t * jpayne@69: hb_face_reference (hb_face_t *face); jpayne@69: jpayne@69: HB_EXTERN void jpayne@69: hb_face_destroy (hb_face_t *face); jpayne@69: jpayne@69: HB_EXTERN hb_bool_t jpayne@69: hb_face_set_user_data (hb_face_t *face, jpayne@69: hb_user_data_key_t *key, jpayne@69: void * data, jpayne@69: hb_destroy_func_t destroy, jpayne@69: hb_bool_t replace); jpayne@69: jpayne@69: HB_EXTERN void * jpayne@69: hb_face_get_user_data (const hb_face_t *face, jpayne@69: hb_user_data_key_t *key); jpayne@69: jpayne@69: HB_EXTERN void jpayne@69: hb_face_make_immutable (hb_face_t *face); jpayne@69: jpayne@69: HB_EXTERN hb_bool_t jpayne@69: hb_face_is_immutable (const hb_face_t *face); jpayne@69: jpayne@69: jpayne@69: HB_EXTERN hb_blob_t * jpayne@69: hb_face_reference_table (const hb_face_t *face, jpayne@69: hb_tag_t tag); jpayne@69: jpayne@69: HB_EXTERN hb_blob_t * jpayne@69: hb_face_reference_blob (hb_face_t *face); jpayne@69: jpayne@69: HB_EXTERN void jpayne@69: hb_face_set_index (hb_face_t *face, jpayne@69: unsigned int index); jpayne@69: jpayne@69: HB_EXTERN unsigned int jpayne@69: hb_face_get_index (const hb_face_t *face); jpayne@69: jpayne@69: HB_EXTERN void jpayne@69: hb_face_set_upem (hb_face_t *face, jpayne@69: unsigned int upem); jpayne@69: jpayne@69: HB_EXTERN unsigned int jpayne@69: hb_face_get_upem (const hb_face_t *face); jpayne@69: jpayne@69: HB_EXTERN void jpayne@69: hb_face_set_glyph_count (hb_face_t *face, jpayne@69: unsigned int glyph_count); jpayne@69: jpayne@69: HB_EXTERN unsigned int jpayne@69: hb_face_get_glyph_count (const hb_face_t *face); jpayne@69: jpayne@69: HB_EXTERN unsigned int jpayne@69: hb_face_get_table_tags (const hb_face_t *face, jpayne@69: unsigned int start_offset, jpayne@69: unsigned int *table_count, /* IN/OUT */ jpayne@69: hb_tag_t *table_tags /* OUT */); jpayne@69: jpayne@69: jpayne@69: /* jpayne@69: * Character set. jpayne@69: */ jpayne@69: jpayne@69: HB_EXTERN void jpayne@69: hb_face_collect_unicodes (hb_face_t *face, jpayne@69: hb_set_t *out); jpayne@69: jpayne@69: HB_EXTERN void jpayne@69: hb_face_collect_variation_selectors (hb_face_t *face, jpayne@69: hb_set_t *out); jpayne@69: jpayne@69: HB_EXTERN void jpayne@69: hb_face_collect_variation_unicodes (hb_face_t *face, jpayne@69: hb_codepoint_t variation_selector, jpayne@69: hb_set_t *out); jpayne@69: jpayne@69: jpayne@69: /* jpayne@69: * Builder face. jpayne@69: */ jpayne@69: jpayne@69: HB_EXTERN hb_face_t * jpayne@69: hb_face_builder_create (void); jpayne@69: jpayne@69: HB_EXTERN hb_bool_t jpayne@69: hb_face_builder_add_table (hb_face_t *face, jpayne@69: hb_tag_t tag, jpayne@69: hb_blob_t *blob); jpayne@69: jpayne@69: jpayne@69: HB_END_DECLS jpayne@69: jpayne@69: #endif /* HB_FACE_H */