From c48cafb421fc8bf10eaa0edf8e6b06116c561a06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Thu, 24 Feb 2022 04:05:02 +0100 Subject: [PATCH] get_glyph_count of text run --- include/vkvg.h | 7 +++++++ src/vkvg_context.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/include/vkvg.h b/include/vkvg.h index 270ebc9..67a2ec5 100644 --- a/include/vkvg.h +++ b/include/vkvg.h @@ -1584,6 +1584,13 @@ void vkvg_show_text_run (VkvgContext ctx, VkvgText textRun); */ vkvg_public void vkvg_text_run_get_extents (VkvgText textRun, vkvg_text_extents_t* extents); +/** + * @brief Get glyph count of text run. + * + * @return glyph count + */ +vkvg_public +uint32_t vkvg_text_run_get_glyph_count (VkvgText textRun); /** * @brief retrieve glyph positions. * diff --git a/src/vkvg_context.c b/src/vkvg_context.c index aab6acb..7d18018 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -1167,6 +1167,9 @@ VkvgText vkvg_text_run_create_with_length (VkvgContext ctx, const char* text, ui _font_cache_create_text_run(ctx, text, length, tr); return tr; } +uint32_t vkvg_text_run_get_glyph_count (VkvgText textRun) { + return textRun->glyph_count; +} void vkvg_text_run_get_glyph_position (VkvgText textRun, uint32_t index, int32_t* const x_advance, -- 2.47.3