summaryrefslogtreecommitdiffstatsci
path: root/include
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-06-13 14:35:24 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-06-13 14:35:24 +0200
commitb983c8bce31bc86955a748e2f1304243f6e39cb9 (patch)
tree4c2cc9df7f73bee497d1a468a36e64b44e2bfcbc /include
parente276913e3476056598e22d877121effe6049a288 (diff)
split text functions to prevent harfbuz code duplication and expose them in vkvg.h
Diffstat (limited to 'include')
-rw-r--r--include/vkvg.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/vkvg.h b/include/vkvg.h
index 359db62..b73f3ce 100644
--- a/include/vkvg.h
+++ b/include/vkvg.h
@@ -125,6 +125,8 @@ typedef struct {
float y_advance;
} vkvg_text_extents_t;
+typedef struct _vkvg_text_run_t* VkvgText;
+
typedef struct _vkvg_context_t* VkvgContext;
typedef struct _vkvg_surface_t* VkvgSurface;
typedef struct _vkvg_device_t* VkvgDevice;
@@ -248,6 +250,12 @@ void vkvg_show_text (VkvgContext ctx, const char* text);
void vkvg_text_extents (VkvgContext ctx, const char* text, vkvg_text_extents_t* extents);
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.
+VkvgText vkvg_text_run_create (VkvgContext ctx, const char* text);
+void vkvg_text_run_destroy (VkvgText textRun);
+void vkvg_show_text_run (VkvgContext ctx, VkvgText textRun);
+vkvg_text_extents_t* vkvg_text_run_get_extents (VkvgText textRun);
+
//pattern
VkvgPattern vkvg_pattern_create ();
VkvgPattern vkvg_pattern_reference (VkvgPattern pat);