中文 | English
This module provides TTF, PCF bitmap font support, as well as JPG and PNG image display support for MicroPython (mpy).
- docs/ -- Related documentation
- examples/ -- Example code and code completion script for the eFont module
- micropython/ -- MicroPython official source code (git submodule)
- mod_efont/ -- Module implementation
- tools/ -- Utility scripts
eFont uses FreeType2, so it supports:
Use the pyftsubset tool from Python fonttools.
pyftsubset fonts\SimYou3D.ttf --text-file=chardict.txt --output-file=simyou-lite.ttf
The compressed format of BDF files on X systems is PCF, which is generally half the size. To further compress PCF files for use in the ESP32 environment, use EPD_bdf2pcf for conversion.
examples/font/ includes two open-source WenQuanYi bitmap fonts.
The target ESP32 S3 platform (N8R2) has a built-in 8MB Flash, with 5.5MB available for images, documents, fonts, and other resources. Refer to Partition File for this partition. The following methods can be used to create an image of this partition for writing to the target chip.
Original project of the tool: https://github.com/labplus-cn/mkfatfs
The parameter after -s should preferably match the size of the vfs partition in the partition; PIO_Core is the installation directory of PlatformIO, usually %userprofile%\.platformio\.
> {PIO_Core}\packages\tool-mkfatfs\mkfatfs -c ./examples -t fatfs -s 4194304 efore_s3_vfs.bin
--- wsl2 shell ---
> esptool.py --before default_reset --after hard_reset --chip esp32s3 --baud 921600 --port /dev/ttyACM0 write_flash -z 0x290000 efore_s3_vfs.bin
--- windows ps ---
> esptool --before default_reset --after hard_reset --chip esp32s3 --baud 921600 --port com6 write_flash -z 0x290000 efore_s3_vfs.bin
>>> import os
>>> os.listdir()
Please refer to build.md
Please refer to Running your first script. there is a main.py is the entry script on the target board, or we can run script from the repl mode.
For the PC enviroment, we can use mpremote, rshell, ... to get REPL, run a script, manage the vfs contents and so on.
For an IDE,RT-Thread Micropython IDE for VSCode may be a good choice.
And the unix port, its default heap size is too small for 3c 10.2' examples, we can do:
mpy -X heapsize=8m page/uiDay.py
-
“The impossibly small web framework for Python and MicroPython”
-
This library provides an object-oriented, asyncio-based wrapper for MicroPython's bluetooth API.
- https://github.com/takkaO/OpenFontRender [FT2 Wrapper Interface]
- https://github.com/kikuchan/pngle [PNG Support]
- http://elm-chan.org/fsw/tjpgd/00index.html [JPG Support]
- https://github.com/russhughes/s3lcd [Graphics Interface]
- https://github.com/qwd/Icons [qWeather-Icons.ttf source]
- https://github.com/coinkite/mpy-qr [qrcode]
- https://github.com/jwygoda/mpy-qr [qrcode for mpy 1.20]
- Chinese Zodiac Signs Icons by StevyG
2023/09/09 | 2023/12/31