Recently a bunch of collaborations announced on the forum have petered out without a result, as people have lost interest. So, to encourage collaborators, I want to talk about a spontaneous and successful collaboration, even though nobody called it that.
This collaboration took place in the thread Set Font, Bold and Italic for Pen Writing Block.
348663451y then proposed to simulate italics similarly, by turning the sprite clockwise a little before printing each character, like this:
That's pretty good, for an easy, quick solution, but it's not really satisfying because the baseline is wiggly instead of straight as it would be in true italics:
Meanwhile, in an unrelated thread, @warped_wart_wars had asked about matrix multiplication. This led me to suggest that a font character could be italicized by applying a linear transformation to its bitmap, multiplying by a transformation matrix such as
so that each point's new x coordinate would become
warped_wart_wars went to work on that.
warped_wart_wars asked for help extracting the pixels from a font-character costume, in black and white (one bit per pixel), so I wrote an expression to do that:
warped_wart_wars, with that start, got the matrix multiplication to work as desired, given a list of the x,y coordinates that have ink on them.
Then @dardoro embedded that matrix code into a project that converts a costume to and from the list of coordinates. But he also pointed out that it's a lot faster just to shift each row of pixels a little further to the right than the one below it, without bothering with matrices.
Meanwhile joecooldoo posted a project carrying out his plan, but it used a fixed spacing between characters. That's fine for a monospace font such as Courier, but not for variable-width fonts such as Arial or (my favorite) Baskerville. So I tried to determine the width of each character. I used the costume's bounding box ( etc.), but had a very persistent bug that made the spacing seem almost random.
Eventually I discovered that the costumes representing the font had their rotation centers at the right edge:
so by stamping the costume and then moving to the right I was effectively using this character's spacing to determine the next character's width.
Once I moved the CHANGE X BY block above the STAMP block, it worked almost perfectly:
The remaining problem, especially in Italic fonts, is that some characters have very flamboyant descenders that are meant to overlap with the next or previous character:
I think the solution to this is to make a subset of the costume with only the pixels above the baseline, and use that to determine the width. But I haven't actually implemented that (so far...).
Five people contributed to these solutions, without having to say "let's have a collaboration to do X."
(This isn't to say that intentional collaborations are bad! They can be very successful, too. I'm just suggesting that more collaborating happens than is captured by those "official" collaborations.)