canvas-hypertxt icon indicating copy to clipboard operation
canvas-hypertxt copied to clipboard

The fastest way to layout wrapped text on a HTML5 canvas

Results 6 canvas-hypertxt issues
Sort by recently updated
recently updated
newest added

- ability to opt-out from cache mechanism, in a scenario when there is too much text in the screen and the user scrolls over it, creating and maintaining cache makes...

We are using this library to render text which the user can enter into a textarea to display as a "note" in a mapping/drawing app. Using the text area, it's...

One example where this library doesn't work well: have a Paragraph with some inline spans that have different styling (e.g. bold, different fontSize etc.) currently the library assumes styling is...

enhancement

What happend: After a few runs `split()` function stops working. With this little snippet written in TS we can reproduce the problem: ``` const testValue1 = `LAJDLKAJDLKAJSLDJALSJDLKASJDLKASJDLKAJSLDJALSKJDKLAJDLKAJDLKJASLDJLAKSJDLKASJDLKAJSLDJALSDJLAKSD ALSKDJALSJDKLSJALKDJASLKDJLKAJDLKAJSDLKJASKDJALSKJDLASJDLKASJLDJASLDJALSKJD`; export const...

```js function renderWrappedText(ctx, value, width, x, y, fontSize, lineHeight) { ctx.font = "600 " + fontSize + "px sans-serif"; let lines = split(ctx, value, fontSize + "px sans-serif", width, true);...

An easy way to reproduce is to add the following spec to the test suite: ```js const consecutiveNewlinesStr = `This is a quite long string that will need to wrap...