4 ms·
thanks. what exactly were you referring to with "I probably could have coded this in the time that it took me to draw my initials in binary pixels."?
by logicallee 13y ago
thanks.
what exactly were you referring to with "I probably could have coded this in the time that it took me to draw my initials in binary pixels."?
- chrissnell 13y agoI could have coded something to generate customized versions of the original source, given three ASCII initials.
- logicallee 13y agoCome on, Chris. I'm a big fan of the humblebrag, but you would still have to draw the binary pixel version of each letter (because C doesn't come with binary pixel array versions of the 26 letters) - so it would be 8 times as much work at an absolute minimum (26 characters versus the 3 that you did), even if the code to embed them in the array were a completely obvious 1-liner, and so was the code to clean up the justification. Let's not flatter ourselves :)
- chrissnell 13y agoDidn't mean to come off as arrogant but there are existing tools that would make this a lot easier. figlet(1) would make the pixel conversion pretty easy. Pixels to binary really isn't that hard. You could do it with a regex.
- derekp7 13y agoAnother way is to use the netpbm toolkit. First, use its ppmdraw command to rasterize each character to a canvas, then convert that canvas to xpm format (you have a separate canvas / picture for each character). The xpm format has the nice property that it is also a valid C structure. Real easy to then convert to whatever you want. Oh, and the netpbm toolkit has not only stand alone binaries, but it also has a C library for each of the conversions that it includes. Seems to be an older under-rated toolkit.
- skrebbel 13y agoRender a Small Fonts text to a text-based monochrome image format with e.g. Imagemagick, read file, and parse each line as binary. Reverse array and separate by commas.