Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/harfbuzz/hb-face.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 HB_EXTERN hb_face_t *
0063 hb_face_create_or_fail (hb_blob_t    *blob,
0064             unsigned int  index);
0065 
0066 HB_EXTERN hb_face_t *
0067 hb_face_create_or_fail_using (hb_blob_t    *blob,
0068                   unsigned int  index,
0069                   const char   *loader_name);
0070 
0071 HB_EXTERN hb_face_t *
0072 hb_face_create_from_file_or_fail (const char   *file_name,
0073                   unsigned int  index);
0074 
0075 HB_EXTERN hb_face_t *
0076 hb_face_create_from_file_or_fail_using (const char   *file_name,
0077                     unsigned int  index,
0078                     const char   *loader_name);
0079 
0080 HB_EXTERN const char **
0081 hb_face_list_loaders (void);
0082 
0083 
0084 /**
0085  * hb_reference_table_func_t:
0086  * @face: an #hb_face_t to reference table for
0087  * @tag: the tag of the table to reference
0088  * @user_data: User data pointer passed by the caller
0089  *
0090  * Callback function for hb_face_create_for_tables(). The @tag is the tag of the
0091  * table to reference, and the special tag #HB_TAG_NONE is used to reference the
0092  * blob of the face itself. If referencing the face blob is not possible, it is
0093  * recommended to set hb_get_table_tags_func_t on the @face to allow
0094  * hb_face_reference_blob() to create a face blob out of individual table blobs.
0095  *
0096  * Return value: (transfer full): A pointer to the @tag table within @face or
0097  * `NULL` if the table is not found or cannot be referenced.
0098  *
0099  * Since: 0.9.2
0100  */
0101 
0102 typedef hb_blob_t * (*hb_reference_table_func_t)  (hb_face_t *face, hb_tag_t tag, void *user_data);
0103 
0104 /* calls destroy() when not needing user_data anymore */
0105 HB_EXTERN hb_face_t *
0106 hb_face_create_for_tables (hb_reference_table_func_t  reference_table_func,
0107                void                      *user_data,
0108                hb_destroy_func_t          destroy);
0109 
0110 HB_EXTERN hb_face_t *
0111 hb_face_get_empty (void);
0112 
0113 HB_EXTERN hb_face_t *
0114 hb_face_reference (hb_face_t *face);
0115 
0116 HB_EXTERN void
0117 hb_face_destroy (hb_face_t *face);
0118 
0119 HB_EXTERN hb_bool_t
0120 hb_face_set_user_data (hb_face_t          *face,
0121                hb_user_data_key_t *key,
0122                void *              data,
0123                hb_destroy_func_t   destroy,
0124                hb_bool_t           replace);
0125 
0126 HB_EXTERN void *
0127 hb_face_get_user_data (const hb_face_t    *face,
0128                hb_user_data_key_t *key);
0129 
0130 HB_EXTERN void
0131 hb_face_make_immutable (hb_face_t *face);
0132 
0133 HB_EXTERN hb_bool_t
0134 hb_face_is_immutable (hb_face_t *face);
0135 
0136 
0137 HB_EXTERN hb_blob_t *
0138 hb_face_reference_table (const hb_face_t *face,
0139              hb_tag_t tag);
0140 
0141 HB_EXTERN hb_blob_t *
0142 hb_face_reference_blob (hb_face_t *face);
0143 
0144 HB_EXTERN void
0145 hb_face_set_index (hb_face_t    *face,
0146            unsigned int  index);
0147 
0148 HB_EXTERN unsigned int
0149 hb_face_get_index (const hb_face_t *face);
0150 
0151 HB_EXTERN void
0152 hb_face_set_upem (hb_face_t    *face,
0153           unsigned int  upem);
0154 
0155 HB_EXTERN unsigned int
0156 hb_face_get_upem (const hb_face_t *face);
0157 
0158 HB_EXTERN void
0159 hb_face_set_glyph_count (hb_face_t    *face,
0160              unsigned int  glyph_count);
0161 
0162 HB_EXTERN unsigned int
0163 hb_face_get_glyph_count (const hb_face_t *face);
0164 
0165 
0166 /**
0167  * hb_get_table_tags_func_t:
0168  * @face: A face object
0169  * @start_offset: The index of first table tag to retrieve
0170  * @table_count: (inout): Input = the maximum number of table tags to return;
0171  *                Output = the actual number of table tags returned (may be zero)
0172  * @table_tags: (out) (array length=table_count): The array of table tags found
0173  * @user_data: User data pointer passed by the caller
0174  *
0175  * Callback function for hb_face_get_table_tags().
0176  *
0177  * Return value: Total number of tables, or zero if it is not possible to list
0178  *
0179  * Since: 10.0.0
0180  */
0181 typedef unsigned int (*hb_get_table_tags_func_t) (const hb_face_t *face,
0182                           unsigned int  start_offset,
0183                           unsigned int *table_count, /* IN/OUT */
0184                           hb_tag_t     *table_tags /* OUT */,
0185                           void         *user_data);
0186 
0187 HB_EXTERN void
0188 hb_face_set_get_table_tags_func (hb_face_t *face,
0189                  hb_get_table_tags_func_t func,
0190                  void                    *user_data,
0191                  hb_destroy_func_t        destroy);
0192 
0193 HB_EXTERN unsigned int
0194 hb_face_get_table_tags (const hb_face_t *face,
0195             unsigned int  start_offset,
0196             unsigned int *table_count, /* IN/OUT */
0197             hb_tag_t     *table_tags /* OUT */);
0198 
0199 
0200 /*
0201  * Character set.
0202  */
0203 
0204 HB_EXTERN void
0205 hb_face_collect_unicodes (hb_face_t *face,
0206               hb_set_t  *out);
0207 
0208 HB_EXTERN void
0209 hb_face_collect_nominal_glyph_mapping (hb_face_t *face,
0210                        hb_map_t  *mapping,
0211                        hb_set_t  *unicodes);
0212 
0213 HB_EXTERN void
0214 hb_face_collect_variation_selectors (hb_face_t *face,
0215                      hb_set_t  *out);
0216 
0217 HB_EXTERN void
0218 hb_face_collect_variation_unicodes (hb_face_t *face,
0219                     hb_codepoint_t variation_selector,
0220                     hb_set_t  *out);
0221 
0222 
0223 /*
0224  * Builder face.
0225  */
0226 
0227 HB_EXTERN hb_face_t *
0228 hb_face_builder_create (void);
0229 
0230 HB_EXTERN hb_bool_t
0231 hb_face_builder_add_table (hb_face_t *face,
0232                hb_tag_t   tag,
0233                hb_blob_t *blob);
0234 
0235 HB_EXTERN void
0236 hb_face_builder_sort_tables (hb_face_t *face,
0237                              const hb_tag_t  *tags);
0238 
0239 
0240 HB_END_DECLS
0241 
0242 #endif /* HB_FACE_H */