Skip to content

sammynave/typesetter

Repository files navigation

https://typesetter.onrender.com/

TODO

  • docs
  • test coverage
  • better typing
  • remove ramda
  • remove hypher and en-us. make them optional with instructions in readme.
  • publish to npm
  • improve api

Hyphenation

This library supports optional hyphenation. hypher seems to work well but any object with a hyphenate method that returns an array of syllables will work. example:

npm i hypher hyphenation.en-us

import Hypher from 'hypher';
import english from 'hyphenation.en-us';

const hyphenator = new Hypher(english);

SvgTypesetter({
	text: 'some text that you want hyphenated when formatting',
	targetNode: textEl,
	parentNode: gEl,
	alignment: 'center',
	lineLengths: [60],
	tolerance: 20000,
	hyphenator
});

About

A library for typesetting text (mainly SVG)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published