Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const renderRun = (ctx, run) => {
const runAdvanceWidth = runWidth(run);
const { font, fontSize, color, opacity } = run.attributes;
ctx.fillColor(color);
ctx.fillOpacity(opacity);
if (font.sbix || (font.COLR && font.CPAL)) {
ctx.save();
ctx.translate(0, -run.ascent);
for (let i = 0; i < run.glyphs.length; i++) {
const position = run.positions[i];
const glyph = run.glyphs[i];
ctx.save();
ctx.translate(position.xOffset, position.yOffset);