Skip to content

Releases: palantir/typesettable

v4.1.0

05 Feb 22:18
62aae63
Compare
Choose a tag to compare

Upgrade to Typescript 2.3

4.0.0

05 Dec 19:06
864e230
Compare
Choose a tag to compare

New Wrapping Logic

Wraps whole words by default. Also, include punctuation in tokens to prevent single character punctuation from wrapping to its own line.

The old behavior can still be used by setting wrapper.allowBreakingWords(true);

New wrap example

Given the string and the available space (|---|):

"Hello, world!"
|-------|

Previously this would wrap like so:

|-------|
Hello, w-
orld!

With this change, we now wrap like so:

|-------|
Hello,
world!

Last resort breaking

Notably, a single word that does not fit in one line may still be broken and hyphenated. like so:

"A very longwordthatdoesntfit"
|------|
A very
longwor-
dthatdo-
esntfit

Punctuation

Additionally, we now consider punctuation to be part of the previous token. This prevents single character punctuation such as "," or "." from being wrapped to its own line.

Previous:

|-----|
A comma
, too.

New

|-----|
A
comma,
too.

v3.1.0

16 Mar 20:20
Compare
Choose a tag to compare

SVG, Canvas, HTML, oh my!

Now Typesettable supports wrapping and writing your text into
SVG, HTML5 Canvas, and vanilla HTML <div>s.

image

3.0.2

08 Mar 22:44
Compare
Choose a tag to compare

Patch Release

Fixes Firefox+Linux issue with measuring bounding boxes of display:none SVG elements.

3.0.1

08 Mar 01:01
Compare
Choose a tag to compare

Patch Release

Removes lingering references to d3 and old repo name

3.0.0

07 Mar 23:54
Compare
Choose a tag to compare

Typesettable

Now with HTML5 Canvas!

Changing library name from "svg-typewriter" to "typesettable"

No Dependencies

Removed the dependency on d3 in favor of simple native browser API.

Simplified API

Now we expose a simple Typesetter API object that has the default measurer, wrapper, and writer. This makes it much easier to quickly wrap and write text with Typesettable.

It's as easy as:

import { Typesetter } from "typesettable";
const typesetter = Typesetter.svg(document.querySelector("svg"));
typesetter.write("Hello World!", 200, 200);

Canvas

This library now supports rendering to Canvas as well as SVG. To use the canvas renderer, just supply a CanvasContext2D with the new Typesetter.canvas factory method. Alternatively, you may use any measurer, wrapper, or writer by providing them with an instance of Typesettable's CanvasContext object.

2.0.0

13 Feb 18:20
Compare
Choose a tag to compare

Update d3 to v4

This major version update includes support for the new version of d3.

v1.1.0

10 Feb 21:16
Compare
Choose a tag to compare

Adds textShear property to IWriterOptions to enable sheared text lines.

The existing textRotation property can only rotate the text in the four cardinal directions, but textShear can be any number of degrees from -80 to 80.

Note that while the lines of sheared text will still be wrapped within the bounds of the "primary" dimension (i.e. "width" in non-rotated text), the text may overflow the bounds of the "secondary" dimension (i.e. "height" in non-rotated text).

In addition, shearing is different than rotation in that the lines will not necessarily be aligned with eachother. Like so:
image

1.0.2

18 Jan 21:09
Compare
Choose a tag to compare

Fix npmignore string to include bundled artifact

1.0.1

18 Jan 20:51
Compare
Choose a tag to compare

Build update

Add browserify bundled artifact to root of project.