Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * Copyright © 2017  Google, 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_OT_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
0028 #error "Include <hb-ot.h> instead."
0029 #endif
0030 
0031 #ifndef HB_OT_VAR_H
0032 #define HB_OT_VAR_H
0033 
0034 #include "hb.h"
0035 
0036 HB_BEGIN_DECLS
0037 
0038 /**
0039  * HB_OT_TAG_VAR_AXIS_ITALIC:
0040  *
0041  * Registered tag for the roman/italic axis.
0042  */
0043 #define HB_OT_TAG_VAR_AXIS_ITALIC   HB_TAG('i','t','a','l')
0044 
0045 /**
0046  * HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE:
0047  *
0048  * Registered tag for the optical-size axis.
0049  * <note>Note: The optical-size axis supersedes the OpenType `size` feature.</note>
0050  */
0051 #define HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE HB_TAG('o','p','s','z')
0052 
0053 /**
0054  * HB_OT_TAG_VAR_AXIS_SLANT:
0055  *
0056  * Registered tag for the slant axis
0057  */
0058 #define HB_OT_TAG_VAR_AXIS_SLANT    HB_TAG('s','l','n','t')
0059 
0060 /**
0061  * HB_OT_TAG_VAR_AXIS_WIDTH:
0062  *
0063  * Registered tag for the width axis.
0064  */
0065 #define HB_OT_TAG_VAR_AXIS_WIDTH    HB_TAG('w','d','t','h')
0066 
0067 /**
0068  * HB_OT_TAG_VAR_AXIS_WEIGHT:
0069  *
0070  * Registered tag for the weight axis.
0071  */
0072 #define HB_OT_TAG_VAR_AXIS_WEIGHT   HB_TAG('w','g','h','t')
0073 
0074 
0075 /*
0076  * fvar / avar
0077  */
0078 
0079 HB_EXTERN hb_bool_t
0080 hb_ot_var_has_data (hb_face_t *face);
0081 
0082 
0083 /*
0084  * Variation axes.
0085  */
0086 
0087 
0088 HB_EXTERN unsigned int
0089 hb_ot_var_get_axis_count (hb_face_t *face);
0090 
0091 /**
0092  * hb_ot_var_axis_flags_t:
0093  * @HB_OT_VAR_AXIS_FLAG_HIDDEN: The axis should not be exposed directly in user interfaces.
0094  *
0095  * Flags for #hb_ot_var_axis_info_t.
0096  *
0097  * Since: 2.2.0
0098  */
0099 typedef enum { /*< flags >*/
0100   HB_OT_VAR_AXIS_FLAG_HIDDEN    = 0x00000001u,
0101 
0102   /*< private >*/
0103   _HB_OT_VAR_AXIS_FLAG_MAX_VALUE= HB_TAG_MAX_SIGNED /*< skip >*/
0104 } hb_ot_var_axis_flags_t;
0105 
0106 /**
0107  * hb_ot_var_axis_info_t:
0108  * @axis_index: Index of the axis in the variation-axis array
0109  * @tag: The #hb_tag_t tag identifying the design variation of the axis
0110  * @name_id: The `name` table Name ID that provides display names for the axis
0111  * @flags: The #hb_ot_var_axis_flags_t flags for the axis
0112  * @min_value: The minimum value on the variation axis that the font covers
0113  * @default_value: The position on the variation axis corresponding to the font's defaults
0114  * @max_value: The maximum value on the variation axis that the font covers
0115  * 
0116  * Data type for holding variation-axis values.
0117  *
0118  * The minimum, default, and maximum values are in un-normalized, user scales.
0119  *
0120  * <note>Note: at present, the only flag defined for @flags is
0121  * #HB_OT_VAR_AXIS_FLAG_HIDDEN.</note>
0122  *
0123  * Since: 2.2.0
0124  */
0125 typedef struct hb_ot_var_axis_info_t {
0126   unsigned int          axis_index;
0127   hb_tag_t          tag;
0128   hb_ot_name_id_t       name_id;
0129   hb_ot_var_axis_flags_t    flags;
0130   float             min_value;
0131   float             default_value;
0132   float             max_value;
0133   /*< private >*/
0134   unsigned int          reserved;
0135 } hb_ot_var_axis_info_t;
0136 
0137 HB_EXTERN unsigned int
0138 hb_ot_var_get_axis_infos (hb_face_t             *face,
0139               unsigned int           start_offset,
0140               unsigned int          *axes_count /* IN/OUT */,
0141               hb_ot_var_axis_info_t *axes_array /* OUT */);
0142 
0143 HB_EXTERN hb_bool_t
0144 hb_ot_var_find_axis_info (hb_face_t             *face,
0145               hb_tag_t               axis_tag,
0146               hb_ot_var_axis_info_t *axis_info);
0147 
0148 
0149 /*
0150  * Named instances.
0151  */
0152 
0153 HB_EXTERN unsigned int
0154 hb_ot_var_get_named_instance_count (hb_face_t *face);
0155 
0156 HB_EXTERN hb_ot_name_id_t
0157 hb_ot_var_named_instance_get_subfamily_name_id (hb_face_t   *face,
0158                         unsigned int instance_index);
0159 
0160 HB_EXTERN hb_ot_name_id_t
0161 hb_ot_var_named_instance_get_postscript_name_id (hb_face_t  *face,
0162                         unsigned int instance_index);
0163 
0164 HB_EXTERN unsigned int
0165 hb_ot_var_named_instance_get_design_coords (hb_face_t    *face,
0166                         unsigned int  instance_index,
0167                         unsigned int *coords_length, /* IN/OUT */
0168                         float        *coords         /* OUT */);
0169 
0170 
0171 /*
0172  * Conversions.
0173  */
0174 
0175 HB_EXTERN void
0176 hb_ot_var_normalize_variations (hb_face_t            *face,
0177                 const hb_variation_t *variations, /* IN */
0178                 unsigned int          variations_length,
0179                 int                  *coords, /* OUT */
0180                 unsigned int          coords_length);
0181 
0182 HB_EXTERN void
0183 hb_ot_var_normalize_coords (hb_face_t    *face,
0184                 unsigned int coords_length,
0185                 const float *design_coords, /* IN */
0186                 int *normalized_coords /* OUT */);
0187 
0188 
0189 HB_END_DECLS
0190 
0191 #endif /* HB_OT_VAR_H */