summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2022-05-27 13:53:14 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2022-05-27 13:53:14 +0100
commit7f5504490fb8fb7ba3916bef7882bd8860a5c0a5 (patch)
tree0cd214bd7565c037644b9fe8d250d135c3783e16 /include
parent7324abb6b05b6f6703667b39f736d6d958cb9460 (diff)
downloadlibrufl-7f5504490fb8fb7ba3916bef7882bd8860a5c0a5.tar.gz
librufl-7f5504490fb8fb7ba3916bef7882bd8860a5c0a5.tar.bz2
Partially revert public API type changes
a4c41198 made a variety of consistency changes to the public API, including changing the type of the "string" parameter passed to many entry points from const char * to const uint8_t *, as that better reflects the data. However, this then forces the user of the API to explicitly cast when passing string constants, or other strings (which, would be passed to standard library APIs as const char *, even if UTF-8 encoded). Revert this part of the change so the type of "string" is once more const char * and cast to the type we actually want internally.
Diffstat (limited to 'include')
-rw-r--r--include/rufl.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/rufl.h b/include/rufl.h
index bb44e49..e7d0987 100644
--- a/include/rufl.h
+++ b/include/rufl.h
@@ -86,7 +86,7 @@ rufl_code rufl_init(void);
rufl_code rufl_paint(const char *font_family, rufl_style font_style,
unsigned int font_size,
- const uint8_t *string, size_t length,
+ const char *string, size_t length,
int x, int y, unsigned int flags);
@@ -96,7 +96,7 @@ rufl_code rufl_paint(const char *font_family, rufl_style font_style,
rufl_code rufl_width(const char *font_family, rufl_style font_style,
unsigned int font_size,
- const uint8_t *string, size_t length,
+ const char *string, size_t length,
int *width);
@@ -106,7 +106,7 @@ rufl_code rufl_width(const char *font_family, rufl_style font_style,
rufl_code rufl_x_to_offset(const char *font_family, rufl_style font_style,
unsigned int font_size,
- const uint8_t *string, size_t length,
+ const char *string, size_t length,
int click_x,
size_t *char_offset, int *actual_x);
@@ -117,7 +117,7 @@ rufl_code rufl_x_to_offset(const char *font_family, rufl_style font_style,
rufl_code rufl_split(const char *font_family, rufl_style font_style,
unsigned int font_size,
- const uint8_t *string, size_t length,
+ const char *string, size_t length,
int width,
size_t *char_offset, int *actual_x);
@@ -135,7 +135,7 @@ typedef void (*rufl_callback_t)(void *context,
rufl_code rufl_paint_callback(const char *font_family, rufl_style font_style,
unsigned int font_size,
- const uint8_t *string, size_t length,
+ const char *string, size_t length,
int x, int y,
rufl_callback_t callback, void *context);
@@ -146,7 +146,7 @@ rufl_code rufl_paint_callback(const char *font_family, rufl_style font_style,
rufl_code rufl_decompose_glyph(const char *font_family,
rufl_style font_style, unsigned int font_size,
- const uint8_t *string, size_t length,
+ const char *string, size_t length,
struct rufl_decomp_funcs *funcs, void *user);
@@ -167,7 +167,7 @@ rufl_code rufl_font_metrics(const char *font_family, rufl_style font_style,
rufl_code rufl_glyph_metrics(const char *font_family,
rufl_style font_style, unsigned int font_size,
- const uint8_t *string, size_t length,
+ const char *string, size_t length,
int32_t *x_bearing, int32_t *y_bearing,
int32_t *width, int32_t *height,
int32_t *x_advance, int32_t *y_advance);