luisgabrielroldan

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 :sweat_smile:)
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 :tada:, 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:

  1. Load the font…
{:ok, font} = Chisel.Font.load("you/font/file.bdf")
  1. … 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:

Samples using OLED lib

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

lawik

Nerves Core Team

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 :slight_smile:

AstonJ

AstonJ

This is so cool! I love the display showing the emojis :003:

Is this the module you are using?

https://www.amazon.co.uk/Hobby-Components-Ltd-SSD1306-Electronics/dp/B00KCM9JMG

LukeWood

LukeWood

Super awesome love it!

Last Post!

lawik

lawik

Nerves Core Team

This here links to datasheets. That should help sus out if they are very different.

Chisel can make the pixels but the I assume the display driver is I2C and that will work/not work depending on what they did to it when they gave it a bigger number :slight_smile:

Addresses might be different. There should be more stuff to write if the resolution is higher and so on.

Where Next?

Popular in Announcing Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New

Other popular topics Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement