<commit_before># Ember-text-measurer

This addon provides a very simple service to measure the width of a string
using an in-memory canvas, so it doesn't cause any layout reflow for max
performance.

### Installation

`ember install ember-text-measurer`

### Usage

This addon just provides a service that you can inject wherever you need.
The service has one single method `measure(string, font = null)` that will
return the width of the text.

```js
textMeasurer.measure('foobar', '24px arial');             // ~ 68.02px
textMeasurer.measure('foobar', '20px arial');             // ~ 56.64px
textMeasurer.measure('foobar', '20px Times New Roman');   // ~ 52.19px
```

### What can I do with this?

Check [THE DEMO](https://ember-text-measurer.pagefrontapp.com) for some ideas ;-)

### Browser compatibility

Pretty good, in theory all back to IE9, although IE9 might give slightly unnacurate results,
probably not innacurate enough to be a problem.<commit_msg>Dummy change to force travis-ci build<commit_after># Ember-text-measurer

This addon provides a very simple service to measure the width of a string
using an in-memory canvas, so it doesn't cause any layout reflow for max
performance.

### Installation

`ember install ember-text-measurer`

### Usage

This addon just provides a service that you can inject wherever you need.
The service has one single method `measure(string, font = null)` that will
return the width of the text.

```js
textMeasurer.measure('foobar', '24px arial');             // ~ 68.02px
textMeasurer.measure('foobar', '20px arial');             // ~ 56.64px
textMeasurer.measure('foobar', '20px Times New Roman');   // ~ 52.19px
```

### What can I do with this?

Check [THE DEMO](https://ember-text-measurer.pagefrontapp.com) for some simple ideas ;-)

### Browser compatibility

Pretty good, in theory all back to IE9, although IE9 might give slightly unnacurate results,
probably not innacurate enough to be a problem.
{'fraction_non_alphanumeric': 0.10076726342710997, 'fraction_numerical': 0.020460358056265986, 'mean_word_length': 3.964467005076142, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6377739', 'n_tokens_mistral': 626, 'n_tokens_neox': 563, 'n_words': 239}