txtjs

A <canvas> font and typesetting engine for CreateJS

Text

Text represents a Word centric textfield that wraps Word instances.

CharacterText

CharacterText represents a "word-less" textfield that wraps per Character.

PathText

PathText represents a textfield that writes Characters to an SVGPath.

Graphics

Graphics extends CreateJS's Graphics Class with the ability to render SVGPath. SVGPath is the basis for all Character and Glyph rendering/caching but can be used directly. These tests are identical to the W3C SVG Tests for SVGPath drawing. The only exception is lack of support for winding rules and 'oddeven' syntax.

Accessibility

By default the txt.Accessibility API is on. The API adds DOM text elements as canvas children that matching the .text property used. The API allows you to further enhance the text written within the canvas element by controlling content in '.accessibilityText' and element order in '.accessibilityPriority'.

About

Txtjs began as an experiment (on a dive trip) to improve the quality of text on <canvas> for web to print apps at Harland Clarke. The idea was to simply render character glyphs to <canvas> using SVGPath drawing commands and build up layout logic progressively. The result is a font and typesetting engine extending CreateJS.

There are many people and projects involved directly and indirectly in the creation and refinement of txtjs.

Warning

Please do not misuse txtjs. It is intended for use for creative applications where style and layout exceed the capabilities of DOM Text or SVG Text. It is not a replacement for DOM Text or SVG Text but rather improves text support on <canvas> for print and design applications. Please do not steal fonts. Txtjs contains an exporter for the txtjs font format and a selection of fonts from the Google Font project licensed as Apache/Ubuntu/OFL. Please respect font owners and their licensed rights when using txtjs in production.

License (BSD)

Copyright (c) 2017, Lightly LLC All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.