!SfJCDXZbMHXkPovtKL:matrix.org

Rust Embedded Graphics

324 Members
Help and chat for embedded-graphics and the wider embedded Rust graphics ecosystem | https://github.com/embedded-graphics/embedded-graphics | https://crates.io/crates/embedded-graphics27 Servers

Load older messages


SenderMessageTime
2 May 2024
@dominaezzz:matrix.orgDominic FischerAbout the same. Probably less overhead with images, since text is images with extra steps.14:47:27
@avsaase:matrix.orgAlexander van SaaseThanks. I mostly need to display some digits and symbols (which I'm currently drawing using basic shapes). Creating my own "font" of bitmap images is probably the best approach then.15:18:50
@jamesmunns:beeper.comJames Munns

Since the space is small (only need to test 10 digits), it might make sense to pick a font, figure out if there's a safe space to manually draw a decimal point (like maybe just a few pixels or a circle in e-g), and just:

  • render the text to a buffer
  • then draw the circle over the buffer manually
15:24:22
@avsaase:matrix.orgAlexander van SaaseI thought about that as well. My display uses a buffer anyway so drawing a point on top is easy and cheap.15:32:13
@jamesmunns:beeper.comJames Munnsmight require some extra inter-char spacing to work well, but that might be something you can either do manually (draw 1 char at a time), I can't remember if e-g lets you increase inter-char spacing15:32:38
@jamesmunns:beeper.comJames Munnsbut either way, a for loop of 4 chars plus a decimal shouldn't be insanely more expensive than drawing 4/5 chars in one go.15:33:37
@jamesmunns:beeper.comJames Munns * but either way, a for loop of 4 chars (one at a time) plus a decimal shouldn't be insanely more expensive than drawing 4/5 chars in one go.15:34:04
@avsaase:matrix.orgAlexander van SaaseI'll give that a try15:34:46
@jamesmunns:beeper.comJames Munnshttps://github.com/wezm/profont has some nice tooling for importing a font, I think I've used that and substituted in another monospace font before15:35:33
@jamesmunns:beeper.comJames Munns(I think that's what I used? I think I managed to import source code pro before)15:36:25
@jamesmunns:beeper.comJames Munnsahh, maybe not. I might have done something more cursed with gimp and exporting it to some binary format 😅15:38:49
@avsaase:matrix.orgAlexander van SaaseI like that idea. The fonts I've found so far have ugly number glyphs imo.15:38:53
@jamesmunns:beeper.comJames MunnsI did... something? I can't remember anymore, to get an 8-bit alpha value to get non-binary font values15:40:36
@jamesmunns:beeper.comJames MunnsI think I found some way to use gimp to output alpha values. This doesn't help if you're using a binary oled where pixels are on or off15:41:11
@avsaase:matrix.orgAlexander van SaaseI'm am15:41:33
@avsaase:matrix.orgAlexander van SaaseI figure something out15:41:41
@avsaase:matrix.orgAlexander van SaaseI'm getting way ahead of myself with the font choice anyway15:42:07
@jamesmunns:beeper.comJames Munns I think I started using the profont tooling to make a source code pro font, and switched to alpha because most fonts didn't look great without alpha blending 15:43:41
@jamesmunns:beeper.comJames Munnsanyway, off topic. I think profont is a pretty mono font tho :)15:43:55
@dngrs:matrix.orgdngrsBDF is really easy to integrate16:10:53
@dngrs:matrix.orgdngrsno alpha tho16:11:08
7 May 2024
@emiluren:matrix.orgEmil Segerbäck joined the room.16:56:42
9 May 2024
@st33f:matrix.orgst33f joined the room.20:23:53
@iron-oxide:matrix.orgiron-oxide joined the room.20:49:53
12 May 2024
@aliarokapis:matrix.orgAlexandros Liarokapis joined the room.22:24:49
13 May 2024
@aliarokapis:matrix.orgAlexandros LiarokapisIs there any way to change the spacing around the font letters?13:50:40
@aliarokapis:matrix.orgAlexandros LiarokapisThe bounding boxes are larger than the contained text14:21:38
@aliarokapis:matrix.orgAlexandros LiarokapisUse profonts currently, is the spacing embedded in the font itself?14:22:02
@sirhcel:matrix.orgsirhcel
In reply to @aliarokapis:matrix.org
Use profonts currently, is the spacing embedded in the font itself?
Do you mean the spacing used when rendering a string of text? This is embedded in the font definition [like for example here](https://github.com/wezm/profont/blob/e2002b24ecba9658bb46cb5fef50e7e7abb41c14/font/src/lib.rs#L55 https://github.com/wezm/profont/blob/e2002b24ecba9658bb46cb5fef50e7e7abb41c14/font/src/lib.rs#L55).
14:36:15
@aliarokapis:matrix.orgAlexandros LiarokapisI guess I can adjust the bounding boxes directly.14:45:23

Show newer messages


Back to Room ListRoom Version: 5