15#ifndef TEXT_GP_TEXT_METRIC_H
16#define TEXT_GP_TEXT_METRIC_H
21enum gp_text_len_type {
71 const char *str,
size_t len);
int gp_coord
Integer type for coordinates i.e. x, y, ...
unsigned int gp_size
Integer type for sizes i.e. w, h, ...
gp_size gp_glyph_advance_x(const gp_text_style *style, uint32_t ch)
Returns a letter advance in horizontal direction.
gp_size gp_text_avg_width(const gp_text_style *style, unsigned int len)
Counts average width for len characters.
size_t gp_text_fit_width(const gp_text_style *style, const char *str, gp_size width)
Counts how many characters will fit into a width pixels.
gp_size gp_text_width_len(const gp_text_style *style, enum gp_text_len_type type, const char *str, size_t len)
Calculates the width of the string drawn in the given style.
gp_size gp_text_max_width(const gp_text_style *style, unsigned int len)
Counts maximal width for len characters.
static gp_size gp_text_wbbox_len(const gp_text_style *style, const char *str, size_t len)
Calculates bounding box width of the string drawn in the given style.
gp_size gp_text_width(const gp_text_style *style, enum gp_text_len_type type, const char *str)
Calculates the width of the string drawn in the given style.
gp_size gp_text_max_width_chars(const gp_text_style *style, const char *chars, unsigned int len)
Returns maximal width for text written with len characters from str.
gp_ssize gp_glyph_bearing_x(const gp_text_style *style, uint32_t ch)
Returns horizontal bearing.
gp_size gp_text_ascent(const gp_text_style *style)
Returns an ascent.
static gp_size gp_text_wbbox(const gp_text_style *style, const char *str)
Calculates bounding box width of the string drawn in the given style.
gp_size gp_text_cur_pos(const gp_text_style *style, const char *str, gp_coord x_off)
Returns position between string characters given an x pixel coordinate from the start of the rendered...
gp_size gp_text_descent(const gp_text_style *style)
Returns a descent.
gp_size gp_text_height(const gp_text_style *style)
Returns maximal text height.