From 36b0e6780b1236d8fa433e9f0bceb61503a5849c Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 31 Jul 2022 21:10:06 +0200 Subject: [PATCH] include: add missing declarations Add nsvgGetTextShapes() and nsvgRasterizeText() declarations outside of the _IMPLEMENTATION areas, so the headerfiles can be used without having _IMPLEMENTATION set. --- include/nanosvg.h | 4 +++- include/nanosvgrast.h | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/nanosvg.h b/include/nanosvg.h index d960f11..158c7f2 100644 --- a/include/nanosvg.h +++ b/include/nanosvg.h @@ -182,6 +182,8 @@ NSVGpath* nsvgDuplicatePath(NSVGpath* p); // Deletes an image. void nsvgDelete(NSVGimage* image); +NSVGshape** nsvgGetTextShapes(NSVGimage* image, char* text, int textLen); + #ifndef NANOSVG_CPLUSPLUS #ifdef __cplusplus } @@ -3088,4 +3090,4 @@ void nsvgDelete(NSVGimage* image) free(image); } -#endif \ No newline at end of file +#endif diff --git a/include/nanosvgrast.h b/include/nanosvgrast.h index e80a57f..9163b71 100644 --- a/include/nanosvgrast.h +++ b/include/nanosvgrast.h @@ -66,6 +66,12 @@ void nsvgRasterize(NSVGrasterizer* r, void nsvgDeleteRasterizer(NSVGrasterizer*); +void nsvgRasterizeText(NSVGrasterizer* r, + NSVGimage* font, float tx, float ty, float scale, + unsigned char* dst, int w, int h, int stride, + char* text); + + #ifndef NANOSVGRAST_CPLUSPLUS #ifdef __cplusplus } @@ -1567,4 +1573,4 @@ void nsvgRasterize(NSVGrasterizer* r, r->stride = 0; } -#endif \ No newline at end of file +#endif