33 const char *
string,
size_t length,
53 const char *
string,
size_t length,
54 int x,
size_t *char_offset,
int *actual_x)
57 if (*char_offset > length)
58 *char_offset = length;
88 const char *
string,
size_t length,
89 int x,
size_t *char_offset,
int *actual_x)
92 if (*char_offset > length) {
93 *char_offset = length;
95 while (*char_offset > 0) {
96 if (
string[*char_offset] ==
' ')
100 if (*char_offset == 0) {
101 *char_offset = c_off;
102 while (*char_offset < length &&
string[*char_offset] !=
' ') {
nserror
Enumeration of error codes.
struct gui_layout_table * monkey_layout_table
static nserror nsfont_position_in_string(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
Find the position in a string where an x coordinate falls.
static nserror nsfont_width(const plot_font_style_t *fstyle, const char *string, size_t length, int *width)
static struct gui_layout_table layout_table
static nserror nsfont_split(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
Find where to split a string to make it fit a width.
Interface to platform-specific layout operation table.
plotter style interfaces, generic styles and style colour helpers.
#define PLOT_STYLE_SCALE
Scaling factor for plot styles.
nserror(* width)(const struct plot_font_style *fstyle, const char *string, size_t length, int *width)
Measure the width of a string.
plot_style_fixed size
Font size, in pt.
size_t utf8_bounded_length(const char *s, size_t l)
Calculated the length (in characters) of a bounded UTF-8 string.
UTF-8 manipulation functions (interface).