tinygo-org / tinyfont

Text library for TinyGo displays
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
49 stars 12 forks source link

Add unicode font and example #10

Closed sago35 closed 4 years ago

sago35 commented 4 years ago

For this PR, the tinyfontgen needed to be improved, so I improved it. And I added a simple sample using NotoEmoji / NotoSans.

I also made a README.md, but I'll delete it if you don't need it.

sago35 commented 4 years ago

The bundled font was created by the following command.

$ tinyfontgen --package notoemoji --fontname NotoEmojiRegular12pt NotoEmoji-Regular-12pt.bdf --output NotoEmoji-Regular-12pt.go --all --verbose
Approx. 3131 bytes

$ tinyfontgen --package notoemoji --fontname NotoEmojiRegular16pt NotoEmoji-Regular-16pt.bdf --output NotoEmoji-Regular-16pt.go --all --verbose
Approx. 4551 bytes

$ tinyfontgen --package notoemoji --fontname NotoEmojiRegular20pt NotoEmoji-Regular-20pt.bdf --output NotoEmoji-Regular-20pt.go --all --verbose
Approx. 6453 bytes

$ tinyfontgen.exe --package notosans --fontname notosans12pt --output notosans12pt.go --string-file strings.txt --verbose NotoSans-Regular-12pt.bdf NotoSansThai-Regular-12pt.bdf NotoSansHebrew-Regular-12pt.bdf NotoSansCJKtc-Regular-12pt.bdf
Approx. 4059 bytes
sago35 commented 4 years ago

The example is now complete. Since we only have pyportal at the moment, all the examples will work only with pyportal.

Please review @deadprogram @conejoninja

deadprogram commented 4 years ago

I am going to squash/merge this now. Thank you very much @sago35 for this awesome contribution!