[vector] Add getter companions for set_flat, set_precision,

set_foreground, set_palette

Every storable setter on hb_vector_draw_t and hb_vector_paint_t
now has a matching getter, matching the symmetry already present
for transform/scale_factor/extents:

  hb_vector_draw_get_flat ()
  hb_vector_draw_get_precision ()
  hb_vector_paint_get_flat ()
  hb_vector_paint_get_precision ()
  hb_vector_paint_get_foreground ()
  hb_vector_paint_get_palette ()

set_glyph_extents has no getter companion since it does not store
its input; it transforms the glyph extents into the context's
pixel-space extents, which are already retrievable via
hb_vector_*_get_extents().

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Behdad Esfahbod committed 2026-04-13 03:38:34 -06:00
1 parent 83b4b27f52
commit d0c9edd7fe
3 files changed
+120

No files matched your search

+34
View File
@@ -675,6 +675,23 @@ hb_vector_draw_set_flat (hb_vector_draw_t *draw,
draw->flat = !!flat;
}
/**
* hb_vector_draw_get_flat:
* @draw: a draw context.
*
* Returns the flatten flag previously set on @draw, or `false` if
* none was set.
*
* Return value: the flatten flag.
*
* XSince: REPLACEME
*/
hb_bool_t
hb_vector_draw_get_flat (const hb_vector_draw_t *draw)
{
return draw->flat;
}
/**
* hb_vector_draw_set_precision:
* @draw: a draw context.
@@ -691,6 +708,23 @@ hb_vector_draw_set_precision (hb_vector_draw_t *draw,
draw->precision = hb_min (precision, 12u);
}
/**
* hb_vector_draw_get_precision:
* @draw: a draw context.
*
* Returns the numeric output precision previously set on @draw,
* or the default if none was set.
*
* Return value: the precision.
*
* XSince: REPLACEME
*/
unsigned
hb_vector_draw_get_precision (const hb_vector_draw_t *draw)
{
return draw->precision;
}
static hb_blob_t *
hb_vector_draw_render_pdf (hb_vector_draw_t *draw)
{
+68
View File
@@ -1127,6 +1127,23 @@ hb_vector_paint_set_foreground (hb_vector_paint_t *paint,
paint->foreground = foreground;
}
/**
* hb_vector_paint_get_foreground:
* @paint: a paint context.
*
* Returns the foreground color previously set on @paint, or the
* default opaque black if none was set.
*
* Return value: the foreground color.
*
* XSince: REPLACEME
*/
hb_color_t
hb_vector_paint_get_foreground (const hb_vector_paint_t *paint)
{
return paint->foreground;
}
/**
* hb_vector_paint_set_palette:
* @paint: a paint context.
@@ -1143,6 +1160,23 @@ hb_vector_paint_set_palette (hb_vector_paint_t *paint,
paint->palette = palette;
}
/**
* hb_vector_paint_get_palette:
* @paint: a paint context.
*
* Returns the palette index previously set on @paint, or 0 if none
* was set.
*
* Return value: the palette index.
*
* XSince: REPLACEME
*/
int
hb_vector_paint_get_palette (const hb_vector_paint_t *paint)
{
return paint->palette;
}
/**
* hb_vector_paint_set_custom_palette_color:
* @paint: a paint context.
@@ -1401,6 +1435,23 @@ hb_vector_paint_set_flat (hb_vector_paint_t *paint,
paint->flat = !!flat;
}
/**
* hb_vector_paint_get_flat:
* @paint: a paint context.
*
* Returns the flatten flag previously set on @paint, or `false` if
* none was set.
*
* Return value: the flatten flag.
*
* XSince: REPLACEME
*/
hb_bool_t
hb_vector_paint_get_flat (const hb_vector_paint_t *paint)
{
return paint->flat;
}
/**
* hb_vector_paint_set_precision:
* @paint: a paint context.
@@ -1417,6 +1468,23 @@ hb_vector_paint_set_precision (hb_vector_paint_t *paint,
paint->precision = hb_min (precision, 12u);
}
/**
* hb_vector_paint_get_precision:
* @paint: a paint context.
*
* Returns the numeric output precision previously set on @paint,
* or the default if none was set.
*
* Return value: the precision.
*
* XSince: REPLACEME
*/
unsigned
hb_vector_paint_get_precision (const hb_vector_paint_t *paint)
{
return paint->precision;
}
/**
* hb_vector_paint_clear:
* @paint: a paint context.
+18
View File
@@ -166,10 +166,16 @@ HB_EXTERN void
hb_vector_draw_set_flat (hb_vector_draw_t *draw,
hb_bool_t flat);
HB_EXTERN hb_bool_t
hb_vector_draw_get_flat (const hb_vector_draw_t *draw);
HB_EXTERN void
hb_vector_draw_set_precision (hb_vector_draw_t *draw,
unsigned precision);
HB_EXTERN unsigned
hb_vector_draw_get_precision (const hb_vector_draw_t *draw);
HB_EXTERN hb_blob_t *
hb_vector_draw_render (hb_vector_draw_t *draw);
@@ -244,10 +250,16 @@ HB_EXTERN void
hb_vector_paint_set_foreground (hb_vector_paint_t *paint,
hb_color_t foreground);
HB_EXTERN hb_color_t
hb_vector_paint_get_foreground (const hb_vector_paint_t *paint);
HB_EXTERN void
hb_vector_paint_set_palette (hb_vector_paint_t *paint,
int palette);
HB_EXTERN int
hb_vector_paint_get_palette (const hb_vector_paint_t *paint);
HB_EXTERN void
hb_vector_paint_set_custom_palette_color (hb_vector_paint_t *paint,
unsigned color_index,
@@ -271,10 +283,16 @@ HB_EXTERN void
hb_vector_paint_set_flat (hb_vector_paint_t *paint,
hb_bool_t flat);
HB_EXTERN hb_bool_t
hb_vector_paint_get_flat (const hb_vector_paint_t *paint);
HB_EXTERN void
hb_vector_paint_set_precision (hb_vector_paint_t *paint,
unsigned precision);
HB_EXTERN unsigned
hb_vector_paint_get_precision (const hb_vector_paint_t *paint);
HB_EXTERN hb_blob_t *
hb_vector_paint_render (hb_vector_paint_t *paint);