From 7ef83c8bd46158a249de9b7cb0ad9e68640de6ac Mon Sep 17 00:00:00 2001 From: madhurpv <136180244+madhurpv@users.noreply.github.com> Date: Sat, 24 Feb 2024 19:22:51 +0530 Subject: [PATCH 1/3] Update Devanagari.ino MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for several symbols like ु ू ृ --- .../Devanagari/Devanagari.ino | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/sys/arduino/u8g2_page_buffer/Devanagari/Devanagari.ino b/sys/arduino/u8g2_page_buffer/Devanagari/Devanagari.ino index b8396cde..8b641263 100644 --- a/sys/arduino/u8g2_page_buffer/Devanagari/Devanagari.ino +++ b/sys/arduino/u8g2_page_buffer/Devanagari/Devanagari.ino @@ -418,17 +418,40 @@ u8g2_uint_t u8g2_draw_unifont_devanagari(u8g2_uint_t x, u8g2_uint_t y, const cha { /* many more glyphs and corrections are missing */ /* please report to https://github.com/olikraus/u8g2/issues/584 */ - case 0x093e: x-= 12; break; - case 0x093f: x-= 19; break; - case 0x0941: x-= 10; y+=3; break; // move down - case 0x0947: x-= 12; break; - case 0x094d: x-= 10; break; + case 0x0901: x-= 14; y-=2; break; // ँँ + case 0x0902: x-= 14; y-=2; break; // move up // ं + case 0x0903: x-= 14; break; // ः + case 0x093e: x-= 12; break; // ा + case 0x093f: x-= 16; break; // ि + case 0x0940: x-= 12; break; // ी + case 0x0941: x-= 15; y+=2; break; // move down // ु + case 0x0942: x-= 12; y+=2; break; // move down // ू + case 0x0943: x-= 16; y+=2; break; // move down // ृ + case 0x0944: x-= 16; y+=2; break; // move down // ॄ + case 0x0945: x-= 14; y-=2; break; // move up // ॅ + case 0x0946: x-= 14; break; // ॆ + case 0x0947: x-= 14; break; // े + case 0x0948: x-= 14; break; // ै + case 0x0949: x-= 14; break; // ै + case 0x094b: x-= 14; break; // ो + case 0x094c: x-= 14; break; // ौ + case 0x094d: x-= 10; break; // ् } delta = u8g2.drawGlyph(x, y, e); switch(e) { - case 0x0941: x-= 3; y -=3; break; // revert the y shift - case 0x094d: x-= 8; break; + case 0x0901: x-= 6; y +=2; break; // revert the y shift + case 0x0902: x-= 6; y +=2; break; // revert the y shift + case 0x0941: x-= 3; y -=2; break; // revert the y shift + case 0x0942: x-= 6; y -=2; break; // revert the y shift + case 0x0943: x-= 4; y -=2; break; // revert the y shift + case 0x0944: x-= 4; y -=2; break; // revert the y shift + case 0x0945: x-= 6; y +=2; break; // revert the y shift + case 0x0946: x-= 2; break; + case 0x0947: x-= 2; break; + case 0x0948: x-= 2; break; + case 0x0949: x-= 2; break; + case 0x094d: x-= 8; break; } x += delta; sum += delta; From a565773bd50bbe5f7fe322860f6d2ce025dd4350 Mon Sep 17 00:00:00 2001 From: madhurpv <136180244+madhurpv@users.noreply.github.com> Date: Sat, 24 Feb 2024 19:25:40 +0530 Subject: [PATCH 2/3] Update Devanagari.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for several symbols like ु ू ृ --- .../examples/page_buffer/Devanagari.cpp | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/sys/rt-thread/examples/page_buffer/Devanagari.cpp b/sys/rt-thread/examples/page_buffer/Devanagari.cpp index 6b8fa707..b20ac627 100644 --- a/sys/rt-thread/examples/page_buffer/Devanagari.cpp +++ b/sys/rt-thread/examples/page_buffer/Devanagari.cpp @@ -278,16 +278,39 @@ static u8g2_uint_t u8g2_draw_unifont_devanagari(u8g2_uint_t x, u8g2_uint_t y, co { /* many more glyphs and corrections are missing */ /* please report to https://github.com/olikraus/u8g2/issues/584 */ - case 0x093e: x-= 12; break; - case 0x093f: x-= 19; break; - case 0x0941: x-= 10; y+=3; break; // move down - case 0x0947: x-= 12; break; - case 0x094d: x-= 10; break; + case 0x0901: x-= 14; y-=2; break; // ँँ + case 0x0902: x-= 14; y-=2; break; // move up // ं + case 0x0903: x-= 14; break; // ः + case 0x093e: x-= 12; break; // ा + case 0x093f: x-= 16; break; // ि + case 0x0940: x-= 12; break; // ी + case 0x0941: x-= 15; y+=2; break; // move down // ु + case 0x0942: x-= 12; y+=2; break; // move down // ू + case 0x0943: x-= 16; y+=2; break; // move down // ृ + case 0x0944: x-= 16; y+=2; break; // move down // ॄ + case 0x0945: x-= 14; y-=2; break; // move up // ॅ + case 0x0946: x-= 14; break; // ॆ + case 0x0947: x-= 14; break; // े + case 0x0948: x-= 14; break; // ै + case 0x0949: x-= 14; break; // ै + case 0x094b: x-= 14; break; // ो + case 0x094c: x-= 14; break; // ौ + case 0x094d: x-= 10; break; // ् } delta = u8g2.drawGlyph(x, y, e); switch(e) { - case 0x0941: x-= 3; y -=3; break; // revert the y shift + case 0x0901: x-= 6; y +=2; break; // revert the y shift + case 0x0902: x-= 6; y +=2; break; // revert the y shift + case 0x0941: x-= 3; y -=2; break; // revert the y shift + case 0x0942: x-= 6; y -=2; break; // revert the y shift + case 0x0943: x-= 4; y -=2; break; // revert the y shift + case 0x0944: x-= 4; y -=2; break; // revert the y shift + case 0x0945: x-= 6; y +=2; break; // revert the y shift + case 0x0946: x-= 2; break; + case 0x0947: x-= 2; break; + case 0x0948: x-= 2; break; + case 0x0949: x-= 2; break; case 0x094d: x-= 8; break; } x += delta; From e3fd8a1b05202fc1f89c8ae864eddfd552bee664 Mon Sep 17 00:00:00 2001 From: madhurpv <136180244+madhurpv@users.noreply.github.com> Date: Sat, 24 Feb 2024 19:27:18 +0530 Subject: [PATCH 3/3] Update main.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for several symbols like ु ू ृ --- sys/sdl/devanagari/main.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/sys/sdl/devanagari/main.c b/sys/sdl/devanagari/main.c index 44fa204b..7bfc5630 100644 --- a/sys/sdl/devanagari/main.c +++ b/sys/sdl/devanagari/main.c @@ -34,16 +34,40 @@ u8g2_uint_t u8g2_draw_unifont_devanagari(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_ switch(e) { - case 0x093e: x-= 12; break; - case 0x093f: x-= 19; break; - case 0x0941: x-= 14; break; - case 0x0947: x-= 12; break; - case 0x094d: x-= 10; break; + case 0x0901: x-= 14; y-=2; break; // ँँ + case 0x0902: x-= 14; y-=2; break; // move up // ं + case 0x0903: x-= 14; break; // ः + case 0x093e: x-= 12; break; // ा + case 0x093f: x-= 16; break; // ि + case 0x0940: x-= 12; break; // ी + case 0x0941: x-= 15; y+=2; break; // move down // ु + case 0x0942: x-= 12; y+=2; break; // move down // ू + case 0x0943: x-= 16; y+=2; break; // move down // ृ + case 0x0944: x-= 16; y+=2; break; // move down // ॄ + case 0x0945: x-= 14; y-=2; break; // move up // ॅ + case 0x0946: x-= 14; break; // ॆ + case 0x0947: x-= 14; break; // े + case 0x0948: x-= 14; break; // ै + case 0x0949: x-= 14; break; // ै + case 0x094b: x-= 14; break; // ो + case 0x094c: x-= 14; break; // ौ + case 0x094d: x-= 10; break; // ् } delta = u8g2_DrawGlyph(u8g2, x, y, e); switch(e) { - case 0x094d: x-= 8; break; + case 0x0901: x-= 6; y +=2; break; // revert the y shift + case 0x0902: x-= 6; y +=2; break; // revert the y shift + case 0x0941: x-= 3; y -=2; break; // revert the y shift + case 0x0942: x-= 6; y -=2; break; // revert the y shift + case 0x0943: x-= 4; y -=2; break; // revert the y shift + case 0x0944: x-= 4; y -=2; break; // revert the y shift + case 0x0945: x-= 6; y +=2; break; // revert the y shift + case 0x0946: x-= 2; break; + case 0x0947: x-= 2; break; + case 0x0948: x-= 2; break; + case 0x0949: x-= 2; break; + case 0x094d: x-= 8; break; } x += delta;