luisgabrielroldan
Chisel - a library to render text on pixel based devices
Hi community!
This is my first post in the forum! (Hope I’m doing it well
)
I want to share with you a project I’ve been working since a couple of weeks.
Some months ago I started to work on a driver for OLED displays based on SSD1306 (very popular and cheap!). It worked, had some primitives to draw points and lines… but that’s not quite useful.
On a second release I added a Scenic driver and the result is nice for graphics, but the text doesn’t looks well because of the antialiasing…
So this week I released the first version of Chisel
, a library that can be used to write text on any device based on pixels (OLED, LCD, a LED Matrix).
Chisel is basically composed by two parts: a Font loader and a Renderer.
The only format supported for now is BDF which is a format for storing bitmap fonts (I want to add support for PCF in the future).
The use is pretty simple:
- Load the font…
{:ok, font} = Chisel.Font.load("you/font/file.bdf")
- … and write the text.
Chisel.Renderer.draw_text("Hello World!", x, y, font, put_pixel)
So… what is put_pixel?
Is just a function that is called with the coordinates of the pixel to paint.
put_pixel = fn x, y ->
device.draw_pixel(x, y)
end
Here there are some examples using OLED and some fonts from U8glib:

And that’s all! What do you think? Did you have this text rendering requirements ever?
I would love to hear some feedback!
Thanks @lawik for testing the first prototype with [Inky] (GitHub - pappersverk/inky: A library for managing Inky e-ink displays from Elixir. · GitHub)!
I hope you can found it useful and to see many people crafting things with tiny displays!
Thanks!
Most Liked
lawik
I love that you made this thing. Absolutely wildly useful for small display projects. As you know there is plenty more I want us to try based off of this ![]()
AstonJ
This is so cool! I love the display showing the emojis ![]()
Is this the module you are using?
https://www.amazon.co.uk/Hobby-Components-Ltd-SSD1306-Electronics/dp/B00KCM9JMG
LukeWood
Super awesome love it!
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








