* @include: hb-ot.h
*
* Functions for fetching color-font information from OpenType font faces.
+ *
+ * HarfBuzz supports COLR/CPAL, sbix, CBDT, and SVG color fonts.
**/
/**
* hb_ot_color_has_palettes:
- * @face: a font face.
+ * @face: #hb_face_t to work upon
+ *
+ * Tests whether a face includes a CPAL color-palette table.
*
- * Returns: whether CPAL table is available.
+ * Return value: true if data found, false otherwise
*
* Since: 2.1.0
*/
/**
* hb_ot_color_palette_get_count:
- * @face: a font face.
+ * @face: #hb_face_t to work upon
+ *
+ * Fetches the number of color palettes in a face.
*
- * Returns: the number of color palettes in @face, or zero if @face has
- * no colors.
+ * Return value: the number of palettes found
*
* Since: 2.1.0
*/
/**
* hb_ot_color_palette_get_name_id:
- * @face: a font face.
- * @palette_index: the index of the color palette whose name is being requested.
+ * @face: #hb_face_t to work upon
+ * @palette_index: The index of the color palette
*
- * Retrieves the name id of a color palette. For example, a color font can
- * have themed palettes like "Spring", "Summer", "Fall", and "Winter".
+ * Fetches the 'name' table Name ID that provides display names for
+ * a CPAL color palette.
*
- * Returns: an identifier within @face's `name` table.
+ * Palette display names can be generic (e.g., "Default") or provide
+ * specific, themed names (e.g., "Spring", "Summer", "Fall", and "Winter").
+ *
+ * Return value: the Named ID found for the palette.
* If the requested palette has no name the result is #HB_OT_NAME_ID_INVALID.
*
* Since: 2.1.0
/**
* hb_ot_color_palette_color_get_name_id:
- * @face: a font face.
- * @color_index: palette entry index.
+ * @face: #hb_face_t to work upon
+ * @color_index: The index of the color
+ *
+ * Fetches the 'name' table Name ID that provides display names for
+ * the specificed color in a face's CPAL color palette.
+ *
+ * Display names can be generic (e.g., "Background") or specific
+ * (e.g., "Eye color").
*
- * Returns: Name ID associated with a palette entry, e.g. eye color
+ * Return value: the Name ID found for the color.
*
* Since: 2.1.0
*/
/**
* hb_ot_color_palette_get_flags:
- * @face: a font face
- * @palette_index: the index of the color palette whose flags are being requested
+ * @face: #hb_face_t to work upon
+ * @palette_index: The index of the color palette
*
- * Returns: the flags for the requested color palette.
+ * Fetches the flags defined for a color palette.
+ *
+ * Return value: the #hb_ot_color_palette_flags_t of the requested color palette
*
* Since: 2.1.0
*/
/**
* hb_ot_color_palette_get_colors:
- * @face: a font face.
- * @palette_index:the index of the color palette whose colors
- * are being requested.
- * @start_offset: the index of the first color being requested.
- * @color_count: (inout) (optional): on input, how many colors
- * can be maximally stored into the @colors array;
- * on output, how many colors were actually stored.
- * @colors: (array length=color_count) (out) (optional):
- * an array of #hb_color_t records. After calling
- * this function, @colors will be filled with
- * the palette colors. If @colors is NULL, the function
- * will just return the number of total colors
- * without storing any actual colors; this can be used
- * for allocating a buffer of suitable size before calling
- * hb_ot_color_palette_get_colors() a second time.
- *
- * Retrieves the colors in a color palette.
- *
- * Returns: the total number of colors in the palette.
+ * @face: #hb_face_t to work upon
+ * @palette_index: the index of the color palette to query
+ * @start_offset: offset of the first color to retrieve
+ * @color_count: (inout) (optional): Input = the maximum number of colors to return;
+ * Output = the actual number of colors returned (may be zero)
+ * @colors: (array length=color_count) (out) (optional): The array of #hb_color_t records found
+ *
+ * Fetches a list of the colors in a color palette.
+ *
+ * After calling this function, @colors will be filled with the palette
+ * colors. If @colors is NULL, the function will just return the number
+ * of total colors without storing any actual colors; this can be used
+ * for allocating a buffer of suitable size before calling
+ * #hb_ot_color_palette_get_colors() a second time.
+ *
+ * Return value: the total number of colors in the palette
*
* Since: 2.1.0
*/
/**
* hb_ot_color_has_layers:
- * @face: a font face.
+ * @face: #hb_face_t to work upon
+ *
+ * Tests whether a face includes any COLR color layers.
*
- * Returns: whether COLR table is available.
+ * Return value: true if data found, false otherwise
*
* Since: 2.1.0
*/
/**
* hb_ot_color_glyph_get_layers:
- * @face: a font face.
- * @glyph: a layered color glyph id.
- * @start_offset: starting offset of layers.
- * @count: (inout) (optional): gets number of layers available to be written on buffer
- * and returns number of written layers.
- * @layers: (array length=count) (out) (optional): layers buffer to buffer.
+ * @face: #hb_face_t to work upon
+ * @glyph: The glyph index to query
+ * @start_offset: offset of the first layer to retrieve
+ * @count: (inout) (optional): Input = the maximum number of layers to return;
+ * Output = the actual number of layers returned (may be zero)
+ * @layers: (array length=count) (out) (optional): The array of layers found
+ *
+ * Fetches a list of all color layers for the specified glyph index in the specified
+ * face. The list returned will begin at the offset provided.
*
- * Returns: Total number of layers a layered color glyph have.
+ * Return value: Total number of layers available for the glyph index queried
*
* Since: 2.1.0
*/
/**
* hb_ot_color_has_svg:
- * @face: a font face.
+ * @face: #hb_face_t to work upon.
*
- * Check whether @face has SVG glyph images.
+ * Tests whether a face includes any SVG glyph images.
*
- * Returns true if available, false otherwise.
+ * Return value: true if data found, false otherwise.
*
* Since: 2.1.0
*/
/**
* hb_ot_color_glyph_reference_svg:
- * @face: a font face.
- * @glyph: a svg glyph index.
+ * @face: #hb_face_t to work upon
+ * @glyph: a svg glyph index
*
- * Get SVG document for a glyph. The blob may be either plain text or gzip-encoded.
+ * Fetches the SVG document for a glyph. The blob may be either plain text or gzip-encoded.
*
- * Returns: (transfer full): respective svg blob of the glyph, if available.
+ * Return value: (transfer full): An #hb_blob_t containing the SVG document of the glyph, if available
*
* Since: 2.1.0
*/
/**
* hb_ot_color_has_png:
- * @face: a font face.
+ * @face: #hb_face_t to work upon
*
- * Check whether @face has PNG glyph images (either CBDT or sbix tables).
+ * Tests whether a face has PNG glyph images (either in CBDT or sbix tables).
*
- * Returns true if available, false otherwise.
+ * Return value: true if data found, false otherwise
*
* Since: 2.1.0
*/
/**
* hb_ot_color_glyph_reference_png:
- * @font: a font object, not face. upem should be set on
- * that font object if one wants to get optimal png blob, otherwise
- * return the biggest one
+ * @font: #hb_font_t to work upon
* @glyph: a glyph index.
*
- * Get PNG image for a glyph.
+ * Fetches the PNG image for a glyph. This function takes a font object, not a face object,
+ * as input. To get an optimally sized PNG blob, the UPEM value must be set on the @font
+ * object. If UPEM is unset, the blob returned will be the largest PNG available.
*
- * Returns: (transfer full): respective PNG blob of the glyph, if available.
+ * Return value: (transfer full): An #hb_blob_t containing the PNG image for the glyph, if available
*
* Since: 2.1.0
*/