From 885eef8ea57e12ecb3c1adcce26c234dd03b3fd9 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 10 Mar 2025 10:33:36 +0200 Subject: [PATCH] [buffer/doc] Add docs for the new cluster level macros --- src/hb-buffer.h | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/hb-buffer.h b/src/hb-buffer.h index ae5f85203..14063ccd0 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -422,7 +422,7 @@ hb_buffer_get_flags (const hb_buffer_t *buffer); * @HB_BUFFER_CLUSTER_LEVEL_CHARACTERS: Don't group cluster values. * @HB_BUFFER_CLUSTER_LEVEL_DEFAULT: Default cluster level, * equal to @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES. - * @HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES: Only group clusters, but don't enfore monotone order. + * @HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES: Only group clusters, but don't enforce monotone order. * * Data type for holding HarfBuzz's clustering behavior options. The cluster level * dictates one aspect of how HarfBuzz will treat non-base characters @@ -430,7 +430,7 @@ hb_buffer_get_flags (const hb_buffer_t *buffer); * * In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES, non-base * characters are merged into the cluster of the base character that precedes them. - * There is also cluster merging evertim the clusters will otherwise become non-monotone. + * There is also cluster merging every time the clusters will otherwise become non-monotone. * * In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS, non-base characters are initially * assigned their own cluster values, which are not merged into preceding base @@ -466,14 +466,43 @@ typedef enum { HB_BUFFER_CLUSTER_LEVEL_DEFAULT = HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES } hb_buffer_cluster_level_t; +/** + * HB_BUFFER_CLUSTER_LEVEL_IS_MONOTONE: + * @level: #hb_buffer_cluster_level_t to test + * + * Tests whether a cluster level groups cluster values into monotone order. + * Requires that the level be valid. + * + * XSince: REPLACEME + */ #define HB_BUFFER_CLUSTER_LEVEL_IS_MONOTONE(level) \ ((bool) ((1u << (unsigned) (level)) & \ ((1u << HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES) | \ (1u << HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS)))) + +/** + * HB_BUFFER_CLUSTER_LEVEL_IS_GRAPHEMES: + * @level: #hb_buffer_cluster_level_t to test + * + * Tests whether a cluster level groups cluster values by graphemes. Requires + * that the level be valid. + * + * XSince: REPLACEME + */ #define HB_BUFFER_CLUSTER_LEVEL_IS_GRAPHEMES(level) \ ((bool) ((1u << (unsigned) (level)) & \ ((1u << HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES) | \ (1u << HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES)))) + +/** + * HB_BUFFER_CLUSTER_LEVEL_IS_CHARACTERS + * @level: #hb_buffer_cluster_level_t to test + * + * Tests whether a cluster level does not group cluster values by graphemes. + * Requires that the level be valid. + * + * XSince: REPLACEME + */ #define HB_BUFFER_CLUSTER_LEVEL_IS_CHARACTERS(level) \ ((bool) ((1u << (unsigned) (level)) & \ ((1u << HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARCATERS) | \