Code Monkey home page Code Monkey logo

Comments (8)

FWeinb avatar FWeinb commented on August 17, 2024

A font definition can maximally contain 255 chars. So we can display the extended ascii set of characters. Arabic letters are not in this set so we can't display them.

One workaround for this is to generate a font definition that consists only of arabic letters and use a little helper function to shift the arabic letters into chars in the 0..254 range. The only caveat would be that you could not mix Arabic and non Arabic letters in the same string.

[Edit]
I made a little demo here I have no idea if this is working correctly, I don't know any arabic and have no idea how it should look on the display. There might be some issues with reading direction because arabic is read from right to left instead of left to right. Take it as a starting point.

from esp8266-oled-ssd1306.

scropion86 avatar scropion86 commented on August 17, 2024

thanks i will test it and update you , and you are correct Arabic is RTL language.
you also can test it with this Arabic Hello World is أهلا بالعالم
and it should be appearing the same in that comment.

from esp8266-oled-ssd1306.

FWeinb avatar FWeinb commented on August 17, 2024

I updated the font to be 16px big and added a reverse function to correctly print the string. I updated the demo here.

from esp8266-oled-ssd1306.

scropion86 avatar scropion86 commented on August 17, 2024

thanks for the Demo , i test the last Demo you provided but as i told you the letters comes aparts and not continuous in words.
Arabic is little bit complicated .

image

from esp8266-oled-ssd1306.

FWeinb avatar FWeinb commented on August 17, 2024

I noticed that but I can't to much about it because I don't understand the rules underpinning the arabic language. I have no idea if there is a simple rule set when to change UTF8 chars on which combination etc.

I am afraid you might be on your own here. If you have any technical questions, feel free to ask. I will try to help as good as I can.

from esp8266-oled-ssd1306.

scropion86 avatar scropion86 commented on August 17, 2024

thanks a lot for your time and effort,i will keep searching if i found a solution i will let you know.

from esp8266-oled-ssd1306.

raphikWasHere avatar raphikWasHere commented on August 17, 2024

Sorry to reopen such an old post but... by chance I found a sketch for Arduino to write Persian on an SSD1306 OLED display. As far as I know Persian uses the arabic alphabet so probably it is also useful for writting Arabic. Besides I have a clue, I don't really know who generated the code, but it certainly wasn't me. The original code didn't work properly but I liked it so much that I took the challenge of making it work. Therefore, my only contribution has been debugging it a little wee. Four cases are considered to decide how a letter is written, depending on the position of the letter: isolated, at the beginning, in the middle or tailing the word. I found it a magnificent piece of software. Anyone can try both codes at:
Original code: https://wokwi.com/projects/372442890656329729
Debugged (and working) code: https://wokwi.com/projects/399060267330575361

Best regards.

from esp8266-oled-ssd1306.

raphikWasHere avatar raphikWasHere commented on August 17, 2024

Clues led me to https://github.com/idreamsi/arduino-persian-reshaper as the maker of the sketch. Or am I wrong?

from esp8266-oled-ssd1306.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.