2 May 2024 |
Dominic Fischer | About the same. Probably less overhead with images, since text is images with extra steps. | 14:47:27 |
Alexander van Saase | Thanks. 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 |
James 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 |
Alexander van Saase | I thought about that as well. My display uses a buffer anyway so drawing a point on top is easy and cheap. | 15:32:13 |
James Munns | might 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 spacing | 15:32:38 |
James Munns | but 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 |
James 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 |
Alexander van Saase | I'll give that a try | 15:34:46 |
James Munns | https://github.com/wezm/profont has some nice tooling for importing a font, I think I've used that and substituted in another monospace font before | 15:35:33 |
James Munns | (I think that's what I used? I think I managed to import source code pro before) | 15:36:25 |
James Munns | ahh, maybe not. I might have done something more cursed with gimp and exporting it to some binary format 😅 | 15:38:49 |
Alexander van Saase | I like that idea. The fonts I've found so far have ugly number glyphs imo. | 15:38:53 |
James Munns | I did... something? I can't remember anymore, to get an 8-bit alpha value to get non-binary font values | 15:40:36 |
James Munns | I 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 off | 15:41:11 |
Alexander van Saase | I'm am | 15:41:33 |
Alexander van Saase | I figure something out | 15:41:41 |
Alexander van Saase | I'm getting way ahead of myself with the font choice anyway | 15:42:07 |
James 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 |
James Munns | anyway, off topic. I think profont is a pretty mono font tho :) | 15:43:55 |
dngrs | BDF is really easy to integrate | 16:10:53 |
dngrs | no alpha tho | 16:11:08 |
7 May 2024 |
| Emil Segerbäck joined the room. | 16:56:42 |
9 May 2024 |
| st33f joined the room. | 20:23:53 |
| iron-oxide joined the room. | 20:49:53 |
12 May 2024 |
| Alexandros Liarokapis joined the room. | 22:24:49 |
13 May 2024 |
Alexandros Liarokapis | Is there any way to change the spacing around the font letters? | 13:50:40 |
Alexandros Liarokapis | The bounding boxes are larger than the contained text | 14:21:38 |
Alexandros Liarokapis | Use profonts currently, is the spacing embedded in the font itself? | 14:22:02 |
sirhcel | 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 |
Alexandros Liarokapis | I guess I can adjust the bounding boxes directly. | 14:45:23 |