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

Unicode support #366

Open
virxkane opened this issue Nov 2, 2021 · 0 comments
Open

Unicode support #366

virxkane opened this issue Nov 2, 2021 · 0 comments

Comments

@virxkane
Copy link

virxkane commented Nov 2, 2021

Hello AdafruitGFX members!
Not so long ago I wrote my own library for rendering bitmap fonts, created by the fontconvert utility from this project. I also modified this utility. This modified utility, unlike the original, allows you to save glyphs in a bitmap font not from one range, but from several. Moreover, when writing character codes, a 32-bit integer is used, i.e. any unicode characters can be included in the generated font. Due to the ability to include characters from several ranges in one font file, characters from several languages can be embedded in it, eliminating unnecessary gaps. This avoids creating multiple files of the same font for each language and switching between them.
Of course:

  • this will increase the bitmap font size by a few bytes, but it can be reduced slightly by eliminating unused characters in between;
  • this will slightly increase the binary code of the library, but such is the price of unicode;
  • this required changing the gfxfont.h file.

It also uses font hinting to make the outline of the font appear more uniform.

If you are interested in adding Unicode support to this project, sources of modified fontconvert utility: https://github.com/virxkane/fontconvert
Sources that render such fonts: https://github.com/virxkane/nucleo-f446re-st7735spi-shield
Most interested code: https://github.com/virxkane/nucleo-f446re-st7735spi-shield/blob/main/Src/gfx.c
All my code is written under BSD-3 license, hopefully it is compatible with this project's license.

I have not studied and never used Adafruit-GFX-Library, I do not know the structure of this project, so I cannot make a PR, but I will be glad if someone does it using my code.

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

No branches or pull requests

1 participant