Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Append an ellipsis to a string that exceeds a specified max-width.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Readme.md

canvas-text-ellipsis

Append an ellipsis to a string that exceeds a specified max-width. Source.

Installation

$ component install bmcmahen/canvas-text-ellipsis

API

var fitString = require('bmcmahen-canvas-text-ellipsis');
ctx.fillText(fitString(ctx, 'a string to truncate', 100), 50, 20);

License

MIT

Something went wrong with that request. Please try again.