How to use the css-line-break.toCodePoints function in css-line-break

To help you get started, we’ve selected a few css-line-break examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github niklasvh / html2canvas / src / render / canvas / canvas-renderer.ts View on Github external
renderTextWithLetterSpacing(text: TextBounds, letterSpacing: number) {
        if (letterSpacing === 0) {
            this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
        } else {
            const letters = toCodePoints(text.text).map(i => fromCodePoint(i));
            letters.reduce((left, letter) => {
                this.ctx.fillText(letter, left, text.bounds.top + text.bounds.height);

                return left + this.ctx.measureText(letter).width;
            }, text.bounds.left);
        }
    }
github niklasvh / html2canvas / src / css / syntax / tokenizer.ts View on Github external
write(chunk: string) {
        this._value = this._value.concat(toCodePoints(chunk));
    }

css-line-break

css-line-break ==============

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis