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

Is there support for Cyrillic in fonts? #252

Closed
SerjPr opened this issue Aug 11, 2023 · 4 comments
Closed

Is there support for Cyrillic in fonts? #252

SerjPr opened this issue Aug 11, 2023 · 4 comments
Assignees
Labels
Waiting for feedback If it's in this state more than 2 months without feedback then the Issue will be closed

Comments

@SerjPr
Copy link

SerjPr commented Aug 11, 2023

Good afternoon. I tried to add Cyrillic through fontconvert.py script. The font is converted, but the Latin works and the Cyrillic does not. Or did I make a mistake due to little experience in the code, or is there no Cyrillic support? I tried different fonts but the result is the same.

@martinberlin
Copy link
Sponsor Collaborator

Please add the .ttf you are using or a link to download it. Add also:

  • the command you are using in fontconvert.py to generate the font
  • the generated font file

Please when you write an issue give full details of what you are trying to do and explain how to reproduce it adding all necessary information.

@SerjPr
Copy link
Author

SerjPr commented Aug 15, 2023

font.zip

python3 fontconvert.py myfont 10 lucida-sans-unicode.ttf > font2_10.h

I used the script provided by LilyGo-EPD47. On it, everything was converted without errors, and the compiler did not swear. Then I found your resource. But the compiler swears at the fonts after your script. I'm new to coding so I could easily make a mistake.

@martinberlin martinberlin self-assigned this Aug 25, 2023
@martinberlin
Copy link
Sponsor Collaborator

Dear @SerjPr
Cyrillic means: "an alphabet used for writing Old Church Slavic and for Russian and a number of other languages of eastern Europe and Asia."

Right? So you are asking about using specific characters that are used for example in Polish/Russian alphabet.
If you open fontconvert.py you will see inside they are defined intervals to render only the characters you need and avoid making a huge fonts header file:

# inclusive unicode code point intervals
# must not overlap and be in ascending order
intervals = [
    (32, 126),
    (160, 255),
    # punctuation
    (0x2010, 0x205F),
    # arrows
    (0x2190, 0x21FF),
    # math
    #(0x2200, 0x22FF),
    # symbols
    (0x2300, 0x23FF),

Try adding there the interval for Cyrillic fonts. Not all font viewers in Linux will show you that part, please get ahold a Font software like Font Forge or similar where you can check the interval range you want to add:

Screenshot from 2023-08-25 14-29-20

After that check if the font itself is in font.h file. Then what I'm not sure if works and you have to try for yourself is to check if drawing that string, the matched character will look-up and print the character. But I think that part you where missing since I don't see any Cyrillic font in your font header file.

@martinberlin martinberlin assigned SerjPr and unassigned martinberlin Sep 14, 2023
@martinberlin martinberlin added the Waiting for feedback If it's in this state more than 2 months without feedback then the Issue will be closed label Sep 14, 2023
@martinberlin
Copy link
Sponsor Collaborator

Posts will be closed after 2 months without replies after the waiting for feedback label is applied. @SerjPr please give some feedback if we can help you further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for feedback If it's in this state more than 2 months without feedback then the Issue will be closed
Projects
None yet
Development

No branches or pull requests

2 participants