]> O.S.I.I.S - jp/vkvg.git/commitdiff
add vkvg_create_text_run_with_length to vkvg.h
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 23 Feb 2022 06:15:25 +0000 (07:15 +0100)
committerj-p <jp_bruyere@hotmail.com>
Sat, 26 Feb 2022 10:04:31 +0000 (11:04 +0100)
include/vkvg.h
src/vkvg_context.c

index e6918def8a78185f59862aafa8357699450379c9..de3dcd9229d0933cdaa0801369cfd9f2006fcae7 100644 (file)
@@ -1533,18 +1533,28 @@ void vkvg_font_extents (VkvgContext ctx, vkvg_font_extents_t* extents);
 
 //text run holds harfbuz datas, and prevent recreating them multiple times for the same line of text.
 /**
- * @brief
+ * @brief Create a new text run.
  *
  * @param ctx a valid vkvg @ref context
- * @param text
+ * @param text Null terminated utf8 string.
  * @return VkvgText
  */
 vkvg_public
 VkvgText vkvg_text_run_create (VkvgContext ctx, const char* text);
 /**
- * @brief
+ * @brief Create a new text run for a non null terminated string.
  *
- * @param textRun
+ * @param ctx a valid vkvg @ref context
+ * @param text non null terminated utf8 string.
+ * @param length glyphs count, not to be confused with byte length.
+ * @return VkvgText
+ */
+vkvg_public
+VkvgText vkvg_text_run_create_with_length (VkvgContext ctx, const char* text, uint32_t length)
+/**
+ * @brief Release ressources holded by the text run.
+ *
+ * @param VkvgtextRun A valid VkvgText pointer.
  */
 vkvg_public
 void vkvg_text_run_destroy (VkvgText textRun);
index f000bf15e970f0702733fc7ec22f029265d2bbc1..868cc6f08b63320a92a86f771fdd64119130c984 100644 (file)
@@ -1149,7 +1149,7 @@ VkvgText vkvg_text_run_create (VkvgContext ctx, const char* text) {
        _font_cache_create_text_run(ctx, text, -1, tr);
        return tr;
 }
-VkvgText vkvg_text_run_create2 (VkvgContext ctx, const char* text, uint32_t length) {
+VkvgText vkvg_text_run_create_with_length (VkvgContext ctx, const char* text, uint32_t length) {
        if (ctx->status)
                return NULL;
        VkvgText tr = (vkvg_text_run_t*)calloc(1, sizeof(vkvg_text_run_t));