|
@@ -3202,6 +3202,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
3202
|
3202
|
#endif
|
3203
|
3203
|
|
3204
|
3204
|
void gdispGDrawChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color) {
|
|
3205
|
+ if (!font)
|
|
3206
|
+ return;
|
3205
|
3207
|
MUTEX_ENTER(g);
|
3206
|
3208
|
g->t.font = font;
|
3207
|
3209
|
g->t.clipx0 = x;
|
|
@@ -3215,6 +3217,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
3215
|
3217
|
}
|
3216
|
3218
|
|
3217
|
3219
|
void gdispGFillChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor) {
|
|
3220
|
+ if (!font)
|
|
3221
|
+ return;
|
3218
|
3222
|
MUTEX_ENTER(g);
|
3219
|
3223
|
g->p.cx = mf_character_width(font, c) + font->baseline_x;
|
3220
|
3224
|
g->p.cy = font->height;
|
|
@@ -3235,6 +3239,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
3235
|
3239
|
}
|
3236
|
3240
|
|
3237
|
3241
|
void gdispGDrawString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color) {
|
|
3242
|
+ if (!font)
|
|
3243
|
+ return;
|
3238
|
3244
|
MUTEX_ENTER(g);
|
3239
|
3245
|
g->t.font = font;
|
3240
|
3246
|
g->t.clipx0 = x;
|
|
@@ -3249,6 +3255,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
3249
|
3255
|
}
|
3250
|
3256
|
|
3251
|
3257
|
void gdispGFillString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color, color_t bgcolor) {
|
|
3258
|
+ if (!font)
|
|
3259
|
+ return;
|
3252
|
3260
|
MUTEX_ENTER(g);
|
3253
|
3261
|
g->p.cx = mf_get_string_width(font, str, 0, 0) + font->baseline_x;
|
3254
|
3262
|
g->p.cy = font->height;
|
|
@@ -3275,6 +3283,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
3275
|
3283
|
uint16_t nbrLines;
|
3276
|
3284
|
#endif
|
3277
|
3285
|
|
|
3286
|
+ if (!font)
|
|
3287
|
+ return;
|
3278
|
3288
|
MUTEX_ENTER(g);
|
3279
|
3289
|
|
3280
|
3290
|
g->t.font = font;
|
|
@@ -3326,6 +3336,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
3326
|
3336
|
uint16_t nbrLines;
|
3327
|
3337
|
#endif
|
3328
|
3338
|
|
|
3339
|
+ if (!font)
|
|
3340
|
+ return;
|
3329
|
3341
|
MUTEX_ENTER(g);
|
3330
|
3342
|
|
3331
|
3343
|
g->p.cx = cx;
|
|
@@ -3382,6 +3394,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
3382
|
3394
|
}
|
3383
|
3395
|
|
3384
|
3396
|
coord_t gdispGetFontMetric(font_t font, fontmetric_t metric) {
|
|
3397
|
+ if (!font)
|
|
3398
|
+ return 0;
|
3385
|
3399
|
/* No mutex required as we only read static data */
|
3386
|
3400
|
switch(metric) {
|
3387
|
3401
|
case fontHeight: return font->height;
|
|
@@ -3397,12 +3411,14 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
3397
|
3411
|
}
|
3398
|
3412
|
|
3399
|
3413
|
coord_t gdispGetCharWidth(char c, font_t font) {
|
|
3414
|
+ if (!font)
|
|
3415
|
+ return 0;
|
3400
|
3416
|
/* No mutex required as we only read static data */
|
3401
|
3417
|
return mf_character_width(font, c);
|
3402
|
3418
|
}
|
3403
|
3419
|
|
3404
|
3420
|
coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count) {
|
3405
|
|
- if (!str)
|
|
3421
|
+ if (!str || !font)
|
3406
|
3422
|
return 0;
|
3407
|
3423
|
|
3408
|
3424
|
// No mutex required as we only read static data
|