Download the PHP package atelier/text without Composer

On this page you can find all versions of the php package atelier/text. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package text

Turn Unicode text into positioned glyphs, vector outlines, and SVG, in PHP.

PHP Version Version Tests PHPUnit PHPStan License

Text drawn as paths owes nothing to the fonts installed on the machine that opens it. This package reads a font file, looks each codepoint up in its cmap, positions the glyphs, and returns their outlines as SVG path data or a complete document.

Font parsing and discovery come from alto/font; document construction comes from atelier/svg. Backed by an extensive test suite and PHPStan at its highest level.

Choosing a font · Public API · Documentation

Installation

Requires PHP 8.4 and ext-mbstring. WOFF2 files also need a Brotli decoder that alto/font supports: either ext-brotli or the brotli command-line binary. Checking which one you have, and what happens without either, is in Installation.

Quick start

Both calls, side by side, are in Getting started.

Path data

path() returns a TextPath, whose d() is the combined outline of the whole run. That is the form to use when the text has to sit inside a drawing you are already building, or be handed to something that only speaks path data.

Letter spacing and word spacing are arguments, not post-processing. baselineY is the line the glyphs sit on rather than the top of the text, which is the one that catches people out. See Path data.

Whole documents

svg() returns an atelier/svg document instead, with one group per glyph carrying a data-char attribute.

Groups carry no id by default. Passing idPrefix makes them deterministic, which is what an animation or a stylesheet needs to address a single glyph. See SVG documents.

Choosing a font

A path is one option; a query against a directory of fonts is the other.

Every format the installed alto/font supports is available here. A query that matches nothing, and how a finder caches what it scans, are in Loading a font.

What it does not do

The mapper performs one direct cmap lookup per codepoint and returns a left-to-right run. It does not do font fallback, bidirectional text, ligatures, kerning, script shaping, or anything HarfBuzz-compatible.

That is a deliberate boundary rather than a gap: Shaping\TextShaperInterface is the seam where a real shaping engine plugs in, and everything downstream consumes its GlyphRun. What that contract already allows, and what writing a replacement takes, are in Shaping.

A codepoint the font has no glyph for throws MissingGlyphException. A size that is not finite and positive, or a non-finite coordinate, throws InvalidArgumentException. Both, and what alto/font throws instead when a file will not load, are in Errors.

Public API

Type What it is for
SvgText the facade: path data and documents, from a file or a finder
FontText an immutable font-backed text specification
TextPathGenerator one combined Outline\TextPath
Outline\OutlinerInterface a seam for custom outline generation
Shaping\TextShaperInterface the shaped-run contract, with GlyphRun, PositionedGlyph, TextDirection

Converters and renderers marked @internal are outside the compatibility promise. Most applications need SvgText and nothing else.

Example

Writes examples/output/woff2/index.html from the bundled open-source Inter fixture.

Documentation

The full documentation is published at ateliersvg.com/text.

Contributing

Contributions are welcome. Visit the project on GitHub to report a bug, suggest a feature, or open a pull request.

Before submitting code, run:

Changes to public behaviour need a test and a documentation update.

Support

Bug reports, security disclosures, and contribution guidelines are collected at ateliersvg.com/support.

License

Atelier Text is released under the MIT License.


All versions of text with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
alto/font Version ^0.8
atelier/svg Version ^1.0
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package atelier/text contains the following files

Loading the files please wait ...