aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp/gdisp.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2015-08-14 20:48:41 +0200
committerJoel Bodenmann <joel@seriouslyembedded.com>2015-08-14 20:48:41 +0200
commitf7075e25ed9bcd701395745161f9ee086c025e21 (patch)
treea0f3ec4c19e6fdc0a61f421e97ad5e63825f3c9b /src/gdisp/gdisp.c
parent608290a261b5577825a31fb4f821e263bc43c094 (diff)
downloaduGFX-f7075e25ed9bcd701395745161f9ee086c025e21.tar.gz
uGFX-f7075e25ed9bcd701395745161f9ee086c025e21.tar.bz2
uGFX-f7075e25ed9bcd701395745161f9ee086c025e21.zip
More work on the TextEdit
Diffstat (limited to 'src/gdisp/gdisp.c')
-rw-r--r--src/gdisp/gdisp.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index 43b470b2..6e431441 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -3324,12 +3324,26 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
return mf_character_width(font, c);
}
+ coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count) {
+ if (!str) {
+ return 0;
+ }
+
+ // No mutex required as we only read static data
+ #if GDISP_NEED_TEXT_KERNING
+ return mf_get_string_width(font, str, count, TRUE);
+ #else
+ return mf_get_string_width(font, str, count, FALSE);
+ #endif
+ }
+
coord_t gdispGetStringWidth(const char* str, font_t font) {
- if (!str)
+ if (!str) {
return 0;
+ }
- /* No mutex required as we only read static data */
- return mf_get_string_width(font, str, 0, 0);
+ // No mutex required as we only read static data
+ return gdispGetStringWidthCount(str, font, 0);
}
#endif