Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:04:01

0001 /*
0002  * Copyright © 2009  Red Hat, Inc.
0003  *
0004  *  This is part of HarfBuzz, a text shaping library.
0005  *
0006  * Permission is hereby granted, without written agreement and without
0007  * license or royalty fees, to use, copy, modify, and distribute this
0008  * software and its documentation for any purpose, provided that the
0009  * above copyright notice and the following two paragraphs appear in
0010  * all copies of this software.
0011  *
0012  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
0013  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
0014  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
0015  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
0016  * DAMAGE.
0017  *
0018  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
0019  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
0020  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
0021  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
0022  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
0023  *
0024  * Red Hat Author(s): Behdad Esfahbod
0025  */
0026 
0027 #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
0028 #error "Include <hb.h> instead."
0029 #endif
0030 
0031 #ifndef HB_FACE_H
0032 #define HB_FACE_H
0033 
0034 #include "hb-common.h"
0035 #include "hb-blob.h"
0036 #include "hb-map.h"
0037 #include "hb-set.h"
0038 
0039 HB_BEGIN_DECLS
0040 
0041 
0042 HB_EXTERN unsigned int
0043 hb_face_count (hb_blob_t *blob);
0044 
0045 
0046 /*
0047  * hb_face_t
0048  */
0049 
0050 /**
0051  * hb_face_t:
0052  *
0053  * Data type for holding font faces.
0054  *
0055  **/
0056 typedef struct hb_face_t hb_face_t;
0057 
0058 HB_EXTERN hb_face_t *
0059 hb_face_create (hb_blob_t    *blob,
0060         unsigned int  index);
0061 
0062 /**
0063  * hb_reference_table_func_t:
0064  * @face: an #hb_face_t to reference table for
0065  * @tag: the tag of the table to reference
0066  * @user_data: User data pointer passed by the caller
0067  *
0068  * Callback function for hb_face_create_for_tables().
0069  *
0070  * Return value: (transfer full): A pointer to the @tag table within @face
0071  *
0072  * Since: 0.9.2
0073  */
0074 
0075 typedef hb_blob_t * (*hb_reference_table_func_t)  (hb_face_t *face, hb_tag_t tag, void *user_data);
0076 
0077 /* calls destroy() when not needing user_data anymore */
0078 HB_EXTERN hb_face_t *
0079 hb_face_create_for_tables (hb_reference_table_func_t  reference_table_func,
0080                void                      *user_data,
0081                hb_destroy_func_t          destroy);
0082 
0083 HB_EXTERN hb_face_t *
0084 hb_face_get_empty (void);
0085 
0086 HB_EXTERN hb_face_t *
0087 hb_face_reference (hb_face_t *face);
0088 
0089 HB_EXTERN void
0090 hb_face_destroy (hb_face_t *face);
0091 
0092 HB_EXTERN hb_bool_t
0093 hb_face_set_user_data (hb_face_t          *face,
0094                hb_user_data_key_t *key,
0095                void *              data,
0096                hb_destroy_func_t   destroy,
0097                hb_bool_t           replace);
0098 
0099 HB_EXTERN void *
0100 hb_face_get_user_data (const hb_face_t    *face,
0101                hb_user_data_key_t *key);
0102 
0103 HB_EXTERN void
0104 hb_face_make_immutable (hb_face_t *face);
0105 
0106 HB_EXTERN hb_bool_t
0107 hb_face_is_immutable (const hb_face_t *face);
0108 
0109 
0110 HB_EXTERN hb_blob_t *
0111 hb_face_reference_table (const hb_face_t *face,
0112              hb_tag_t tag);
0113 
0114 HB_EXTERN hb_blob_t *
0115 hb_face_reference_blob (hb_face_t *face);
0116 
0117 HB_EXTERN void
0118 hb_face_set_index (hb_face_t    *face,
0119            unsigned int  index);
0120 
0121 HB_EXTERN unsigned int
0122 hb_face_get_index (const hb_face_t *face);
0123 
0124 HB_EXTERN void
0125 hb_face_set_upem (hb_face_t    *face,
0126           unsigned int  upem);
0127 
0128 HB_EXTERN unsigned int
0129 hb_face_get_upem (const hb_face_t *face);
0130 
0131 HB_EXTERN void
0132 hb_face_set_glyph_count (hb_face_t    *face,
0133              unsigned int  glyph_count);
0134 
0135 HB_EXTERN unsigned int
0136 hb_face_get_glyph_count (const hb_face_t *face);
0137 
0138 
0139 /**
0140  * hb_get_table_tags_func_t:
0141  * @face: A face object
0142  * @start_offset: The index of first table tag to retrieve
0143  * @table_count: (inout): Input = the maximum number of table tags to return;
0144  *                Output = the actual number of table tags returned (may be zero)
0145  * @table_tags: (out) (array length=table_count): The array of table tags found
0146  * @user_data: User data pointer passed by the caller
0147  *
0148  * Callback function for hb_face_get_table_tags().
0149  *
0150  * Return value: Total number of tables, or zero if it is not possible to list
0151  *
0152  * Since: 10.0.0
0153  */
0154 typedef unsigned int (*hb_get_table_tags_func_t) (const hb_face_t *face,
0155                           unsigned int  start_offset,
0156                           unsigned int *table_count, /* IN/OUT */
0157                           hb_tag_t     *table_tags /* OUT */,
0158                           void         *user_data);
0159 
0160 HB_EXTERN void
0161 hb_face_set_get_table_tags_func (hb_face_t *face,
0162                  hb_get_table_tags_func_t func,
0163                  void                    *user_data,
0164                  hb_destroy_func_t        destroy);
0165 
0166 HB_EXTERN unsigned int
0167 hb_face_get_table_tags (const hb_face_t *face,
0168             unsigned int  start_offset,
0169             unsigned int *table_count, /* IN/OUT */
0170             hb_tag_t     *table_tags /* OUT */);
0171 
0172 
0173 /*
0174  * Character set.
0175  */
0176 
0177 HB_EXTERN void
0178 hb_face_collect_unicodes (hb_face_t *face,
0179               hb_set_t  *out);
0180 
0181 HB_EXTERN void
0182 hb_face_collect_nominal_glyph_mapping (hb_face_t *face,
0183                        hb_map_t  *mapping,
0184                        hb_set_t  *unicodes);
0185 
0186 HB_EXTERN void
0187 hb_face_collect_variation_selectors (hb_face_t *face,
0188                      hb_set_t  *out);
0189 
0190 HB_EXTERN void
0191 hb_face_collect_variation_unicodes (hb_face_t *face,
0192                     hb_codepoint_t variation_selector,
0193                     hb_set_t  *out);
0194 
0195 
0196 /*
0197  * Builder face.
0198  */
0199 
0200 HB_EXTERN hb_face_t *
0201 hb_face_builder_create (void);
0202 
0203 HB_EXTERN hb_bool_t
0204 hb_face_builder_add_table (hb_face_t *face,
0205                hb_tag_t   tag,
0206                hb_blob_t *blob);
0207 
0208 HB_EXTERN void
0209 hb_face_builder_sort_tables (hb_face_t *face,
0210                              const hb_tag_t  *tags);
0211 
0212 
0213 HB_END_DECLS
0214 
0215 #endif /* HB_FACE_H */