Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added examples to display arabic using LGFX #669

Closed
wants to merge 4 commits into from

Conversation

ZXTube
Copy link

@ZXTube ZXTube commented Jan 16, 2025

After starting this issue: #655
tobozo recommended that I make a pull request with the arabic example added so I did.

I added two folders:

  1. examples/HowToUse/4_unicode_fonts/arabic
  2. examples/HowToUse/4_unicode_fonts/arabic_quran

both showcase two different ways of trying to display arabic the first uses the usual arabic unicode and modifies it with the code, and the second makes use of the private use section in unicode and assigns a unicode for each letter for each form for each tashkeel (diacritical marks). (Not all possible combinations are included because the font was made for quran only)

Thank you.

@tobozo
Copy link
Collaborator

tobozo commented Jan 17, 2025

hi,

thanks for contributing 👍

  • The first example is missing the Amiri font OFL license (stating it should be present with the redistributed ttf files).

main/arabic_u8g2.c

  Fontname: -FreeType-Amiri-Medium-R-Normal--32-320-72-72-P-199-ISO10646-1
  Copyright: Copyright 2010-2022 The Amiri Project Authors (https://github.com/aliftype/amiri).
  Glyphs: 489/1556
  BBX Build Mode: 0
  • The quran font seems to have an even stronger license, "licensed to you" implies a personal scope, and/or that the font can't be redistributed unless there's a written approval:
  Fontname: -FreeType-KFGQPC Hafs Smart-Medium-R-Normal--43-320-96-96-P-257-ISO10646-1
  Copyright: The digitally signed machine readable Typeface(Font) licensed to you is copyrighted, (2010), King Fahd Glorious Quran Printing Complex.  ISBN: 978-603-8187-46-3 , Accession No. 1438/1348  All rights reserved. This Font is the property of King Fahd Glorious Quran Printing Complex, and may not be reproduced, modified without the express written approval of King Fahd Glorious Quran Printing Complex.
  Glyphs: 2739/2739
  BBX Build Mode: 0
  • 132 text files in one example folder is a lot, the arabic_quran folder will probably be better as a whole project, especially if the quran fonts can't be separated from their text.

  • If the license issue can't be solved, is there an alternative font to demonstrate the use of the private section in unicode table?

  • The examples format is using esp-idf layout, but LovyanGFX folder structure is using arduino layout, a quick fix is to add an .ino file named after the parent folder, and include main/main.cpp from there:

examples/HowToUse/4_unicode_fonts/arabic/arabic.ino

@ZXTube
Copy link
Author

ZXTube commented Jan 17, 2025

  • I completely forgot about copyright thanks for pointing that out. I'll look for ways to contact King Fahd Glorious Quran Printing Complex.
  • I'll make the arabic_quran folder into a new project. Though should I add a link to the project in the 4_unicode_fonts folder
  • I'll edit this when I understand your 3rd point. (I don't have much experience with arduino)

@tobozo
Copy link
Collaborator

tobozo commented Jan 17, 2025

3rd point is straightforward, to make the folder compliant with Arduino example style, e.g. if the example sketch folder is named arabic, the ino file must be named arabic.ino.

All you have to do is create this file:

examples/HowToUse/4_unicode_fonts/arabic/arabic.ino

then paste this code:

#include "main/main.cpp"

The second example only needs a generic text sample (max 100 chars) to demonstrate the advertised feature.
It's okay to leave a link to the more extended version of the project in the source code of that short example.

@lovyan03
Copy link
Owner

Thank you for the pull request.
I think you should create it in your own repository and promote it.
I don't see the need to merge this.

@ZXTube
Copy link
Author

ZXTube commented Jan 21, 2025

What about just it being the Arabic example that uses google's font Amiri?

@lovyan03
Copy link
Owner

Please keep your example code concise and easy to understand.
If you want to publish your work, please do so in your own repository, not through me.

@lovyan03 lovyan03 closed this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants