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

feature: allow multiple ttf fonts at the same time #49

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

sago35
Copy link
Member

@sago35 sago35 commented Oct 19, 2024

This PR extends tinyfontgen-ttf to allow loading multiple TTF fonts, enabling simultaneous display of languages such as Japanese and Korean.

Additionally, it introduces examples/unicode_font3_const2bit using the new tinyfontgen-ttf. This ensures that issues, like the one in #43, can be detected immediately if they occur.

@sago35
Copy link
Member Author

sago35 commented Oct 19, 2024

At this point, heap allocation remains in const2bit. This will be improved in #48.

$ tinygo flash -target pyportal -size short --print-allocs . ./examples/unicode_font3_const2bit
C:\Users\sago3\dev\pkg\mod\tinygo.org\x\[email protected]\ili9341\parallel_atsamd51.go:33:26: object allocated on the heap: escapes at line 33
C:\Users\sago3\dev\pkg\mod\tinygo.org\x\[email protected]\ili9341\parallel_atsamd51.go:28:16: object allocated on the heap: escapes at line 28
C:\Users\sago3\dev\src\tinygo.org\x\tinyfont\const2bit\const2bit.go:119:9: object allocated on the heap: escapes at line 119
C:\tinygo\tinygo\src\runtime\string.go:86:14: object allocated on the heap: size is not constant
C:\tinygo\tinygo\src\runtime\baremetal.go:43:14: object allocated on the heap: size is not constant
C:\tinygo\tinygo\src\runtime\slice.go:50:14: object allocated on the heap: size is not constant
C:\Go\src\errors\errors.go:62:21: object allocated on the heap: escapes at line 62
C:\tinygo\tinygo\src\internal\task\task_stack.go:75:24: object allocated on the heap: size is not constant
C:\tinygo\tinygo\src\internal\task\task_stack.go:113:12: object allocated on the heap: escapes at line 115
   code    data     bss |   flash     ram
  24056     228    6696 |   24284    6924

@sago35 sago35 marked this pull request as draft October 19, 2024 11:10
@sago35
Copy link
Member Author

sago35 commented Oct 19, 2024

I will revise the commit message to align with the others, so I'll mark it as a draft for now. The code is already complete, so it's fine to review it if you'd like.

@sago35 sago35 marked this pull request as ready for review October 19, 2024 11:19
@sago35
Copy link
Member Author

sago35 commented Oct 19, 2024

Now ready for review

@deadprogram deadprogram changed the title Multiple ttf font feature: allow Multiple ttf fonts at the same time Oct 23, 2024
@deadprogram deadprogram changed the title feature: allow Multiple ttf fonts at the same time feature: allow multiple ttf fonts at the same time Oct 23, 2024
@deadprogram
Copy link
Member

This is a very cool feature @sago35 thanks for working on it! I certainly see why you needed it 😸

Now merging.

@deadprogram deadprogram merged commit 31ce933 into dev Oct 23, 2024
1 check passed
@deadprogram deadprogram deleted the multiple-ttf-font branch October 23, 2024 10:14
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.

2 participants