[vector] Rename hb_vector_svg_*set_{flat,precision} API

Drop "svg" from the names since flat/precision settings apply
equally to PDF output.  The new names follow the hb_vector_draw_*
/ hb_vector_paint_* convention:

  hb_vector_svg_set_flat         -> hb_vector_draw_set_flat
  hb_vector_svg_set_precision    -> hb_vector_draw_set_precision
  hb_vector_svg_paint_set_flat   -> hb_vector_paint_set_flat
  hb_vector_svg_paint_set_precision -> hb_vector_paint_set_precision

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Behdad Esfahbod committed 2026-04-10 12:16:55 -06:00
1 parent 0967927b88
commit 30ee1bb2c6
6 files changed
+28 -28

No files matched your search

+4 -4
View File
@@ -259,10 +259,10 @@ Wednesday, March 4, 2026
+hb_vector_paint_set_scale_factor()
+hb_vector_paint_set_transform()
+hb_vector_paint_set_user_data()
+hb_vector_svg_paint_set_flat()
+hb_vector_svg_paint_set_precision()
+hb_vector_svg_set_flat()
+hb_vector_svg_set_precision()
+hb_vector_paint_set_flat()
+hb_vector_paint_set_precision()
+hb_vector_draw_set_flat()
+hb_vector_draw_set_precision()
Overview of changes leading to 12.3.2
+6 -6
View File
@@ -628,32 +628,32 @@ hb_vector_draw_glyph (hb_vector_draw_t *draw,
}
/**
* hb_vector_svg_set_flat:
* hb_vector_draw_set_flat:
* @draw: a draw context.
* @flat: whether to flatten geometry and disable reuse.
*
* Enables or disables SVG draw flattening.
* Enables or disables draw flattening.
*
* Since: 13.0.0
*/
void
hb_vector_svg_set_flat (hb_vector_draw_t *draw,
hb_vector_draw_set_flat (hb_vector_draw_t *draw,
hb_bool_t flat)
{
draw->flat = !!flat;
}
/**
* hb_vector_svg_set_precision:
* hb_vector_draw_set_precision:
* @draw: a draw context.
* @precision: decimal precision.
*
* Sets numeric output precision for SVG draw output.
* Sets numeric output precision for draw output.
*
* Since: 13.0.0
*/
void
hb_vector_svg_set_precision (hb_vector_draw_t *draw,
hb_vector_draw_set_precision (hb_vector_draw_t *draw,
unsigned precision)
{
draw->precision = hb_min (precision, 12u);
+6 -6
View File
@@ -1469,32 +1469,32 @@ hb_vector_paint_glyph (hb_vector_paint_t *paint,
}
/**
* hb_vector_svg_paint_set_flat:
* hb_vector_paint_set_flat:
* @paint: a paint context.
* @flat: whether to flatten paint output and disable glyph-group reuse.
*
* Enables or disables SVG paint flattening.
* Enables or disables paint flattening.
*
* Since: 13.0.0
*/
void
hb_vector_svg_paint_set_flat (hb_vector_paint_t *paint,
hb_vector_paint_set_flat (hb_vector_paint_t *paint,
hb_bool_t flat)
{
paint->flat = !!flat;
}
/**
* hb_vector_svg_paint_set_precision:
* hb_vector_paint_set_precision:
* @paint: a paint context.
* @precision: decimal precision.
*
* Sets numeric output precision for SVG paint output.
* Sets numeric output precision for paint output.
*
* Since: 13.0.0
*/
void
hb_vector_svg_paint_set_precision (hb_vector_paint_t *paint,
hb_vector_paint_set_precision (hb_vector_paint_t *paint,
unsigned precision)
{
paint->precision = hb_min (precision, 12u);
+4 -4
View File
@@ -162,11 +162,11 @@ hb_vector_draw_glyph (hb_vector_draw_t *draw,
hb_vector_extents_mode_t extents_mode);
HB_EXTERN void
hb_vector_svg_set_flat (hb_vector_draw_t *draw,
hb_vector_draw_set_flat (hb_vector_draw_t *draw,
hb_bool_t flat);
HB_EXTERN void
hb_vector_svg_set_precision (hb_vector_draw_t *draw,
hb_vector_draw_set_precision (hb_vector_draw_t *draw,
unsigned precision);
HB_EXTERN hb_blob_t *
@@ -264,11 +264,11 @@ hb_vector_paint_glyph (hb_vector_paint_t *paint,
hb_vector_extents_mode_t extents_mode);
HB_EXTERN void
hb_vector_svg_paint_set_flat (hb_vector_paint_t *paint,
hb_vector_paint_set_flat (hb_vector_paint_t *paint,
hb_bool_t flat);
HB_EXTERN void
hb_vector_svg_paint_set_precision (hb_vector_paint_t *paint,
hb_vector_paint_set_precision (hb_vector_paint_t *paint,
unsigned precision);
HB_EXTERN hb_blob_t *
+4 -4
View File
@@ -21,10 +21,10 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
hb_vector_paint_set_foreground (paint, HB_COLOR (0, 0, 0, 255));
unsigned precision = size ? data[size - 1] % 5 : 0;
hb_vector_svg_set_precision (draw, precision);
hb_vector_svg_paint_set_precision (paint, precision);
hb_vector_svg_set_flat (draw, size > 1 ? !!(data[size - 2] & 1) : false);
hb_vector_svg_paint_set_flat (paint, size > 2 ? !!(data[size - 3] & 1) : false);
hb_vector_draw_set_precision (draw, precision);
hb_vector_paint_set_precision (paint, precision);
hb_vector_draw_set_flat (draw, size > 1 ? !!(data[size - 2] & 1) : false);
hb_vector_paint_set_flat (paint, size > 2 ? !!(data[size - 3] & 1) : false);
unsigned glyph_count = hb_face_get_glyph_count (input.face);
unsigned limit = glyph_count > 16 ? 16 : glyph_count;
+4 -4
View File
@@ -188,8 +188,8 @@ struct vector_output_t : output_options_t<>, view_options_t
hb_vector_draw_set_scale_factor (draw, 1.f, 1.f);
hb_vector_draw_set_extents (draw, &extents);
hb_vector_svg_set_precision (draw, precision);
hb_vector_svg_set_flat (draw, flat);
hb_vector_draw_set_precision (draw, precision);
hb_vector_draw_set_flat (draw, flat);
if (paint)
{
@@ -199,8 +199,8 @@ struct vector_output_t : output_options_t<>, view_options_t
hb_vector_paint_set_palette (paint, this->palette);
apply_custom_palette (paint);
init_palette_color_cache ();
hb_vector_svg_paint_set_precision (paint, precision);
hb_vector_svg_paint_set_flat (paint, flat);
hb_vector_paint_set_precision (paint, precision);
hb_vector_paint_set_flat (paint, flat);
}
bool had_draw = false;