Path: blob/master/src/java.desktop/share/native/libharfbuzz/hb-face.h
41152 views
/*1* Copyright © 2009 Red Hat, Inc.2*3* This is part of HarfBuzz, a text shaping library.4*5* Permission is hereby granted, without written agreement and without6* license or royalty fees, to use, copy, modify, and distribute this7* software and its documentation for any purpose, provided that the8* above copyright notice and the following two paragraphs appear in9* all copies of this software.10*11* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR12* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES13* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN14* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH15* DAMAGE.16*17* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,18* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND19* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS20* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO21* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.22*23* Red Hat Author(s): Behdad Esfahbod24*/2526#if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)27#error "Include <hb.h> instead."28#endif2930#ifndef HB_FACE_H31#define HB_FACE_H3233#include "hb-common.h"34#include "hb-blob.h"35#include "hb-set.h"3637HB_BEGIN_DECLS383940HB_EXTERN unsigned int41hb_face_count (hb_blob_t *blob);424344/*45* hb_face_t46*/4748/**49* hb_face_t:50*51* Data type for holding font faces.52*53**/54typedef struct hb_face_t hb_face_t;5556HB_EXTERN hb_face_t *57hb_face_create (hb_blob_t *blob,58unsigned int index);5960/**61* hb_reference_table_func_t:62* @face: an #hb_face_t to reference table for63* @tag: the tag of the table to reference64* @user_data: User data pointer passed by the caller65*66* Callback function for hb_face_create_for_tables().67*68* Return value: (transfer full): A pointer to the @tag table within @face69*70* Since: 0.9.271*/7273typedef hb_blob_t * (*hb_reference_table_func_t) (hb_face_t *face, hb_tag_t tag, void *user_data);7475/* calls destroy() when not needing user_data anymore */76HB_EXTERN hb_face_t *77hb_face_create_for_tables (hb_reference_table_func_t reference_table_func,78void *user_data,79hb_destroy_func_t destroy);8081HB_EXTERN hb_face_t *82hb_face_get_empty (void);8384HB_EXTERN hb_face_t *85hb_face_reference (hb_face_t *face);8687HB_EXTERN void88hb_face_destroy (hb_face_t *face);8990HB_EXTERN hb_bool_t91hb_face_set_user_data (hb_face_t *face,92hb_user_data_key_t *key,93void * data,94hb_destroy_func_t destroy,95hb_bool_t replace);9697HB_EXTERN void *98hb_face_get_user_data (const hb_face_t *face,99hb_user_data_key_t *key);100101HB_EXTERN void102hb_face_make_immutable (hb_face_t *face);103104HB_EXTERN hb_bool_t105hb_face_is_immutable (const hb_face_t *face);106107108HB_EXTERN hb_blob_t *109hb_face_reference_table (const hb_face_t *face,110hb_tag_t tag);111112HB_EXTERN hb_blob_t *113hb_face_reference_blob (hb_face_t *face);114115HB_EXTERN void116hb_face_set_index (hb_face_t *face,117unsigned int index);118119HB_EXTERN unsigned int120hb_face_get_index (const hb_face_t *face);121122HB_EXTERN void123hb_face_set_upem (hb_face_t *face,124unsigned int upem);125126HB_EXTERN unsigned int127hb_face_get_upem (const hb_face_t *face);128129HB_EXTERN void130hb_face_set_glyph_count (hb_face_t *face,131unsigned int glyph_count);132133HB_EXTERN unsigned int134hb_face_get_glyph_count (const hb_face_t *face);135136HB_EXTERN unsigned int137hb_face_get_table_tags (const hb_face_t *face,138unsigned int start_offset,139unsigned int *table_count, /* IN/OUT */140hb_tag_t *table_tags /* OUT */);141142143/*144* Character set.145*/146147HB_EXTERN void148hb_face_collect_unicodes (hb_face_t *face,149hb_set_t *out);150151HB_EXTERN void152hb_face_collect_variation_selectors (hb_face_t *face,153hb_set_t *out);154155HB_EXTERN void156hb_face_collect_variation_unicodes (hb_face_t *face,157hb_codepoint_t variation_selector,158hb_set_t *out);159160161/*162* Builder face.163*/164165HB_EXTERN hb_face_t *166hb_face_builder_create (void);167168HB_EXTERN hb_bool_t169hb_face_builder_add_table (hb_face_t *face,170hb_tag_t tag,171hb_blob_t *blob);172173174HB_END_DECLS175176#endif /* HB_FACE_H */177178179