Closed josuah closed 1 year ago
This is only the font generation, along with a script for plotting it as text, but this means both sides of the implementation currently work:
$ wget http://unifoundry.com/pub/unifont/unifont-15.0.06/font-builds/unifont-15.0.06.bdf.gz
$ gunzip unifont-15.0.06.bdf.gz
$ python3 fontgen unifont-15.0.06.bdf unifont-15.0.06.bin
$ python3 fontdraw.py unifont-15.0.06.bin "八つ橋"
八
# |
# # |
# # |
# # |
# # |
# # |
# # |
# # |
# # |
# # |
# # |
# # |
# # |
# # |
# #|
つ
##### |
# ## # |
## #|
#|
#|
#|
# |
## |
### |
橋
# ## |
# #### |
# # |
# #########|
###### # # |
# # ### # |
## # # # #|
### ### |
# # # |
# # # ####### |
# # # # |
# # ### # |
# # # # # |
# # ### # |
# # # |
# # ## |
$
This format has an index that can be read in Python array, and can tell where to find the data in the rest of the file. As opposed to a full memory-mapped bitmap like http://unifoundry.com/pub/unifont/unifont-15.0.01/unifont-15.0.01.bmp, this permits:
.
is smaller to store than 龍
There will be a host-side
fontgen.py
script to generate a packed font file, to upload as either a file on the filesystem, either built into the firmware.There will be a device-side
font.py
to render a font out of that font data onto a canvas, and use that canvas to send it to the FPGA.