diff options
Diffstat (limited to 'src/gdisp/gdisp.h')
| -rw-r--r-- | src/gdisp/gdisp.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h index 4513f3f7..d0c31ebb 100644 --- a/src/gdisp/gdisp.h +++ b/src/gdisp/gdisp.h @@ -72,7 +72,9 @@ typedef enum fontmetric { fontLineSpacing, /**< The line spacing */ fontCharPadding, /**< The char padding */ fontMinWidth, /**< The minimum width */ - fontMaxWidth /**< The maximum width */ + fontMaxWidth, /**< The maximum width */ + fontBaselineX, /**< The base line in x direction */ + fontBaselineY /**< The base line in y direction */ } fontmetric_t; /** @@ -109,7 +111,7 @@ typedef enum powermode { /* * Our black box display structure. */ -typedef struct GDisplay GDisplay; +typedef struct GDisplay GDisplay; /** * @brief The default screen to use for the gdispXXXX calls. @@ -976,7 +978,22 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co coord_t gdispGetCharWidth(char c, font_t font); /** - * @brief Get the pixel width of a string. + * @brief Get the pixel width of a string of a given character length. + * @return The width of the string in pixels. + * @pre GDISP_NEED_TEXT must be TRUE in your gfxconf.h + * + * @note Passing 0 to count has the same effect as calling gdispGetStringWidt() + * + * @param[in] str The string to measure + * @param[in] font The font to use + * @param[in] count The number of characters to take into account + * + * @api + */ + coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count); + + /** + * @brief Get the pixel width of an entire string. * @return The width of the string in pixels. * @pre GDISP_NEED_TEXT must be TRUE in your gfxconf.h * |
