!SfJCDXZbMHXkPovtKL:matrix.org

Rust Embedded Graphics

303 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
@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
@sirhcel:matrix.orgsirhcel Does not look like this is trivially possible with just modifying the font struct fields. character_size defines the source rect for copying glyph data from the bitmap and gets applied consecutively and character_spacing gets added between the glyphs when rendering. 14:55:11
@sirhcel:matrix.orgsirhcel

To me it looks like the actual font rendering for MonoFont would need some tweaking in your case. Do you know profonts debugger tool? It's a great help when playing around on a desktop system. You could invoke it as

profont/tools $ cargo run --bin profont debugger
14:57:26
@sirhcel:matrix.orgsirhcel *

To me it looks like the actual font rendering for MonoFont would need some tweaking in your case. Do you know profonts debugger tool? It's a great help when playing around with these things on a desktop system. You could invoke it as

profont/tools $ cargo run --bin profont debugger
14:57:43

Show newer messages


Back to Room ListRoom Version: 5