Costume from text using a dot matrix type font

with a few additions over the standard costume from text block in that you can define your background colour and border

Got a few more plans for it but it seems good enough at the moment to publish

ProjectName=costumeFromMatrixFont

The fourth one takes ~1.6 seconds for me. That's pretty slow.

It's not been speed optimised and it's all deliberately done in native Snap! without any use of any custom JS blocks :slight_smile:

Part of it could be the long input.

Yes, that's probably it, along with pixel calculations.

The basic single char block takes about twice as long as the library costume from text block

Which isn't bad considering it isn't using any JS helper blocks (unlike the libary one)

Once Snap! 7 is released, I can rewrite them using some primitive helpers and then it should be comparable with the library block but with more features :slight_smile:

I guess. (I haven't actually timed the library one, but for me, it's pretty much instant.)

20ms vs 40ms (On average)
Both instant as far as user is concerned

I get this:


(repetitions input to "time of" block just makes it more accurate by averaging out the values of different times)
Times are in milliseconds, so 1.6887 seconds for your block, 0.0882 seconds for the library block.

My times were for the single char scenario :slight_smile:

Added a warp block around my inner loop and that has brought the times down considerably

image

image

I got it pretty consistently 670 to 700 milliseconds with a warp around the entire block.

Updated the reporter to use a 5x9 font which gives true descenders

Old font
image

New font
image

If I gave anyone a pixel font, it'd be 5x13.

Have you got a data source for one? I'd try it out :slight_smile:

I'm quite happy with the improvement in looks that the 5x9 one gives in a project - much better than the previous 5x7

image

Data source?

A URL to somewhere that I could copy the bit patterns for each char

Would a Snap! project work?

What about capturing font pixels with Snap

?