3 ms·
I've actually been investigating exactly this over the last weekend for a FF4 tracker-music program. I need colored monospace characters, and Canvas is the fast
by chipsy 16y ago
I've actually been investigating exactly this over the last weekend for a FF4 tracker-music program. I need colored monospace characters, and Canvas is the fastest(straightforward) method I've found to do it.
I tried DOM manipulation, but I couldn't make it run quickly with a color-per-character scheme, or even after some segmentation into the specific needs of the tracker. I am not an expert at that subject, though, so I've probably overlooked a lot of the tricks.
Within Canvas I looked into caching the characters as bitmaps and drawing those, but it turned out that FF4 Canvas has a lot of fixed overhead in each API call, so my best bet was to batch each color used into a different layer, and draw them row-by-row, layer-by-layer with textFill(). If textFill() were to let me use newlines it would be even better.