Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * Copyright © 2016  Google, Inc.
0003  * Copyright © 2018  Khaled Hosny
0004  * Copyright © 2018  Ebrahim Byagowi
0005  *
0006  *  This is part of HarfBuzz, a text shaping library.
0007  *
0008  * Permission is hereby granted, without written agreement and without
0009  * license or royalty fees, to use, copy, modify, and distribute this
0010  * software and its documentation for any purpose, provided that the
0011  * above copyright notice and the following two paragraphs appear in
0012  * all copies of this software.
0013  *
0014  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
0015  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
0016  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
0017  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
0018  * DAMAGE.
0019  *
0020  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
0021  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
0022  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
0023  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
0024  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
0025  *
0026  * Google Author(s): Sascha Brawer, Behdad Esfahbod
0027  */
0028 
0029 #if !defined(HB_OT_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
0030 #error "Include <hb-ot.h> instead."
0031 #endif
0032 
0033 #ifndef HB_OT_COLOR_H
0034 #define HB_OT_COLOR_H
0035 
0036 #include "hb.h"
0037 #include "hb-ot-name.h"
0038 
0039 HB_BEGIN_DECLS
0040 
0041 
0042 /*
0043  * Color palettes.
0044  */
0045 
0046 HB_EXTERN hb_bool_t
0047 hb_ot_color_has_palettes (hb_face_t *face);
0048 
0049 HB_EXTERN unsigned int
0050 hb_ot_color_palette_get_count (hb_face_t *face);
0051 
0052 HB_EXTERN hb_ot_name_id_t
0053 hb_ot_color_palette_get_name_id (hb_face_t *face,
0054                  unsigned int palette_index);
0055 
0056 HB_EXTERN hb_ot_name_id_t
0057 hb_ot_color_palette_color_get_name_id (hb_face_t *face,
0058                        unsigned int color_index);
0059 
0060 /**
0061  * hb_ot_color_palette_flags_t:
0062  * @HB_OT_COLOR_PALETTE_FLAG_DEFAULT: Default indicating that there is nothing special
0063  *   to note about a color palette.
0064  * @HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND: Flag indicating that the color
0065  *   palette is appropriate to use when displaying the font on a light background such as white.
0066  * @HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND: Flag indicating that the color
0067  *   palette is appropriate to use when displaying the font on a dark background such as black.
0068  *
0069  * Flags that describe the properties of color palette.
0070  *
0071  * Since: 2.1.0
0072  */
0073 typedef enum { /*< flags >*/
0074   HB_OT_COLOR_PALETTE_FLAG_DEFAULT          = 0x00000000u,
0075   HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND = 0x00000001u,
0076   HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND  = 0x00000002u
0077 } hb_ot_color_palette_flags_t;
0078 
0079 HB_EXTERN hb_ot_color_palette_flags_t
0080 hb_ot_color_palette_get_flags (hb_face_t *face,
0081                    unsigned int palette_index);
0082 
0083 HB_EXTERN unsigned int
0084 hb_ot_color_palette_get_colors (hb_face_t    *face,
0085                 unsigned int  palette_index,
0086                 unsigned int  start_offset,
0087                 unsigned int *color_count,  /* IN/OUT.  May be NULL. */
0088                 hb_color_t   *colors        /* OUT.     May be NULL. */);
0089 
0090 
0091 /*
0092  * Color layers.
0093  */
0094 
0095 HB_EXTERN hb_bool_t
0096 hb_ot_color_has_layers (hb_face_t *face);
0097 
0098 /**
0099  * hb_ot_color_layer_t:
0100  * @glyph: the glyph ID of the layer
0101  * @color_index: the palette color index of the layer
0102  *
0103  * Pairs of glyph and color index.
0104  *
0105  * A color index of 0xFFFF does not refer to a palette
0106  * color, but indicates that the foreground color should
0107  * be used.
0108  *
0109  * Since: 2.1.0
0110  **/
0111 typedef struct hb_ot_color_layer_t {
0112   hb_codepoint_t glyph;
0113   unsigned int   color_index;
0114 } hb_ot_color_layer_t;
0115 
0116 HB_EXTERN unsigned int
0117 hb_ot_color_glyph_get_layers (hb_face_t           *face,
0118                   hb_codepoint_t       glyph,
0119                   unsigned int         start_offset,
0120                   unsigned int        *layer_count, /* IN/OUT.  May be NULL. */
0121                   hb_ot_color_layer_t *layers /* OUT.     May be NULL. */);
0122 
0123 /* COLRv1 */
0124 
0125 HB_EXTERN hb_bool_t
0126 hb_ot_color_has_paint (hb_face_t *face);
0127 
0128 HB_EXTERN hb_bool_t
0129 hb_ot_color_glyph_has_paint (hb_face_t      *face,
0130                              hb_codepoint_t  glyph);
0131 
0132 /*
0133  * SVG
0134  */
0135 
0136 HB_EXTERN hb_bool_t
0137 hb_ot_color_has_svg (hb_face_t *face);
0138 
0139 HB_EXTERN hb_blob_t *
0140 hb_ot_color_glyph_reference_svg (hb_face_t *face, hb_codepoint_t glyph);
0141 
0142 /*
0143  * PNG: CBDT or sbix
0144  */
0145 
0146 HB_EXTERN hb_bool_t
0147 hb_ot_color_has_png (hb_face_t *face);
0148 
0149 HB_EXTERN hb_blob_t *
0150 hb_ot_color_glyph_reference_png (hb_font_t *font, hb_codepoint_t glyph);
0151 
0152 
0153 HB_END_DECLS
0154 
0155 #endif /* HB_OT_COLOR_H */