[GH-ISSUE #458] Unicode support to truetype rendering #1383

Open
opened 2026-03-20 19:07:49 +01:00 by sascha_hemi · 2 comments
Owner

Originally created by @lukedoomer on GitHub (Apr 19, 2025).
Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/458

Describe the bug
according to the tutorial Uploading & Using Custom Fonts
cannot make openepaperlink display any cjk character

To Reproduce

  1. upload popular fonts to /fonts
    droid-sans-mono.ttf
    NotoSansMono-Regular.ttf
  2. upload local json template to root fs
[
    {"text": [5,5,"ABCぁ あ ぃ い ぅ うXYZ","fonts/droidsansmono.ttf",1]},
    {"box": [10,30,20,20,1]},
    {"box": [35,30,20,20,2]},
    {"triangle": [60,30,60,50,80,40,1]},
    {"text": [5,80,"ABCァ ア ィ イ ゥXYZ","droidsansmono.ttf",1]},
    {"text": [5,95,"Plain text 7x14_tf","7x14_tf",2]},
    {"text": [5,110,"Plain text t0_14b_tf","t0_14b_tf",1]},
    {"text": [135,5,"ABCㄅ ㄆ ㄇ ㄈ ㄉ ㄊXYZ","fonts/notosansmono.ttf",2]},
    {"text": [215,5,"70","fonts/bahnschrift70",1]},
    {"text": [150,80,"50","fonts/calibrib50",2,0]},
    {"text": [205,60,"80","fonts/calibrib80",2]},
    {"text": [90,35,"ABC一 二 三 四 五XYZ","notosansmono.ttf",1]},
    {"line": [10,120,290,120,1]},
    {"line": [10,115,290,115,2]}
]
  1. See error
    no any alphabet/character with custom font

Screenshots
Image

Expected behavior
display CJK character properly

Originally created by @lukedoomer on GitHub (Apr 19, 2025). Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/458 **Describe the bug** according to the tutorial [Uploading & Using Custom Fonts](https://github.com/OpenEPaperLink/OpenEPaperLink/wiki/Uploading-&-Using-Custom-Fonts,-with-examples) cannot make openepaperlink display any cjk character **To Reproduce** 1. upload popular fonts to /fonts `droid-sans-mono.ttf` `NotoSansMono-Regular.ttf` 3. upload local json template to root fs ``` [ {"text": [5,5,"ABCぁ あ ぃ い ぅ うXYZ","fonts/droidsansmono.ttf",1]}, {"box": [10,30,20,20,1]}, {"box": [35,30,20,20,2]}, {"triangle": [60,30,60,50,80,40,1]}, {"text": [5,80,"ABCァ ア ィ イ ゥXYZ","droidsansmono.ttf",1]}, {"text": [5,95,"Plain text 7x14_tf","7x14_tf",2]}, {"text": [5,110,"Plain text t0_14b_tf","t0_14b_tf",1]}, {"text": [135,5,"ABCㄅ ㄆ ㄇ ㄈ ㄉ ㄊXYZ","fonts/notosansmono.ttf",2]}, {"text": [215,5,"70","fonts/bahnschrift70",1]}, {"text": [150,80,"50","fonts/calibrib50",2,0]}, {"text": [205,60,"80","fonts/calibrib80",2]}, {"text": [90,35,"ABC一 二 三 四 五XYZ","notosansmono.ttf",1]}, {"line": [10,120,290,120,1]}, {"line": [10,115,290,115,2]} ] ``` 6. See error no any alphabet/character with custom font **Screenshots** ![Image](https://github.com/user-attachments/assets/d3665023-3b67-48b5-a87b-522996639ed3) **Expected behavior** display CJK character properly
sascha_hemi added the bug label 2026-03-20 19:07:49 +01:00
Author
Owner

@nlimper commented on GitHub (Apr 19, 2025):

The current Truetype library we use, sadly doesn't do Unicode.
Two possible solutions:

  • add Unicode decoding to the current library (/src/truetype.cpp, function textDraw and/or codeToGlyphId)
  • or, change to a different truetype render library. Here is a good one: https://github.com/takkaO/OpenFontRender , with the big advantage that it also parses the hinting tables.

Both options take quite a bit of work to implement (and test). If somebody has the time to spend on this, be my guest... I'm willing to take a look at it, but it will only be after the summer.

<!-- gh-comment-id:2816653796 --> @nlimper commented on GitHub (Apr 19, 2025): The current Truetype library we use, sadly doesn't do Unicode. Two possible solutions: - add Unicode decoding to the current library (/src/truetype.cpp, function textDraw and/or codeToGlyphId) - or, change to a different truetype render library. Here is a good one: https://github.com/takkaO/OpenFontRender , with the big advantage that it also parses the hinting tables. Both options take quite a bit of work to implement (and test). If somebody has the time to spend on this, be my guest... I'm willing to take a look at it, but it will only be after the summer.
Author
Owner

@lukedoomer commented on GitHub (Apr 20, 2025):

Thanks. Hope the unicode render will come to this great project eventually. Unicode is a must for me and modern use case.

<!-- gh-comment-id:2816908015 --> @lukedoomer commented on GitHub (Apr 20, 2025): Thanks. Hope the unicode render will come to this great project eventually. Unicode is a must for me and modern use case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#1383