render method
Implementation
@override
void render() {
if (!_imageLoaded) return;
_display.render((x, y, glyph) {
var char = glyph.char;
// Remap it if it's a Unicode character.
char = unicodeMap[char] ?? char;
var sx = (char % 32) * _charWidth;
var sy = (char ~/ 32) * _charHeight;
// Fill the background.
_context.fillStyle = glyph.back.cssColor;
_context.fillRect(x * _charWidth * _scale, y * _charHeight * _scale,
_charWidth * _scale, _charHeight * _scale);
// Don't bother drawing empty characters.
if (char == 0 || char == CharCode.space) return;
var color = _getColorFont(glyph.fore);
_context.imageSmoothingEnabled = false;
_context.drawImageScaledFromSource(
color,
sx,
sy,
_charWidth,
_charHeight,
x * _charWidth * _scale,
y * _charHeight * _scale,
_charWidth * _scale,
_charHeight * _scale);
});
}