RE: https://mastodon.gamedev.place/@eniko/116279471062633993

ok this might be a zany ass idea but... what if... 320x200 but with 2 pixel tall dither as a stylistic choice? eh? eh? eh? :D

wake up babe new font just dropped

look ma, no text jumping*!

*in my wordwrapped typewriter text

@eniko Perfect! How are you managing wrapping?

EDIT: Wait, I suppose you're just not showing the text, right? It's formatted once and you just unroll it?

@Ronflaix i made an iterative wrapText function that goes word by word (spaces/newlines count as words) and which detects when a word goes over the wrap width, and bumps it to the next line

and then i made an iterative typewriter function that draws the text one character of a word at a time and which advances the wrapText iterator when it's done rendering the word

@eniko Ooh, clever! Thanks for the info!

@Ronflaix yeah i actually did the "lay it out once" thing in C# way back when but this seemed cleaner

that way i can also use wrapText to measure the full width+height of text by just iterating until it's done and reading the max width and height properties of the iterator

@Ronflaix oh right i also have an iterative function that gets the next word, which the wrapText function uses

so really its 3 iterators deep but that makes it sound more complex than it really is >_>

@eniko Yeah, it's generic but I see the design and if it makes the actual code flow easier, why not?

I suppose you also select glyphs variants on the fly? Positional variants, ligatures and all the bells & whistles too? :D

@Ronflaix oh god no :'D this is just a simple ascii font and so each character just has its pixel width, and the advance is width + the font's char spacing