mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 04:41:26 +04:00
* Revert "[FL-3729, FL-3730] Gui: fix string width calculation (#3305)" * Revert "Added UTF-8 support to Flipper Zero canvas API (#3297)"
This commit is contained in:
@@ -150,7 +150,7 @@ void canvas_draw_str(Canvas* canvas, uint8_t x, uint8_t y, const char* str) {
|
||||
if(!str) return;
|
||||
x += canvas->offset_x;
|
||||
y += canvas->offset_y;
|
||||
u8g2_DrawUTF8(&canvas->fb, x, y, str);
|
||||
u8g2_DrawStr(&canvas->fb, x, y, str);
|
||||
}
|
||||
|
||||
void canvas_draw_str_aligned(
|
||||
@@ -169,10 +169,10 @@ void canvas_draw_str_aligned(
|
||||
case AlignLeft:
|
||||
break;
|
||||
case AlignRight:
|
||||
x -= u8g2_GetUTF8Width(&canvas->fb, str);
|
||||
x -= u8g2_GetStrWidth(&canvas->fb, str);
|
||||
break;
|
||||
case AlignCenter:
|
||||
x -= (u8g2_GetUTF8Width(&canvas->fb, str) / 2);
|
||||
x -= (u8g2_GetStrWidth(&canvas->fb, str) / 2);
|
||||
break;
|
||||
default:
|
||||
furi_crash();
|
||||
@@ -193,13 +193,13 @@ void canvas_draw_str_aligned(
|
||||
break;
|
||||
}
|
||||
|
||||
u8g2_DrawUTF8(&canvas->fb, x, y, str);
|
||||
u8g2_DrawStr(&canvas->fb, x, y, str);
|
||||
}
|
||||
|
||||
uint16_t canvas_string_width(Canvas* canvas, const char* str) {
|
||||
furi_assert(canvas);
|
||||
if(!str) return 0;
|
||||
return u8g2_GetUTF8Width(&canvas->fb, str);
|
||||
return u8g2_GetStrWidth(&canvas->fb, str);
|
||||
}
|
||||
|
||||
uint8_t canvas_glyph_width(Canvas* canvas, uint16_t symbol) {
|
||||
@@ -321,10 +321,10 @@ static void canvas_draw_u8g2_bitmap_int(
|
||||
|
||||
void canvas_draw_u8g2_bitmap(
|
||||
u8g2_t* u8g2,
|
||||
uint8_t x,
|
||||
uint8_t y,
|
||||
uint8_t w,
|
||||
uint8_t h,
|
||||
u8g2_uint_t x,
|
||||
u8g2_uint_t y,
|
||||
u8g2_uint_t w,
|
||||
u8g2_uint_t h,
|
||||
const uint8_t* bitmap,
|
||||
IconRotation rotation) {
|
||||
u8g2_uint_t blen;
|
||||
|
||||
@@ -96,4 +96,4 @@ void canvas_draw_u8g2_bitmap(
|
||||
uint8_t width,
|
||||
uint8_t height,
|
||||
const uint8_t* bitmap,
|
||||
IconRotation rotation);
|
||||
uint8_t rotation);
|
||||
|
||||
Reference in New Issue
Block a user