Download the PHP package laxit/sigil without Composer

On this page you can find all versions of the php package laxit/sigil. 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 sigil

Umbral Sigilstone

💜 Umbral Sigilstone — PHP

laxit/sigil — turns an integer into one recognizable Cistercian-style glyph, rendered as SVG, ASCII or DXF. Four digits by default, more on request.

The Umbral Sigilstone presses a number into a single struck mark: one stem and a handful of strokes, identical everywhere it is struck — in pixels, in ink, or in cut metal.

Packagist Version PHP Version CI Downloads


7323 built from 7000 + 300 + 20 + 3, one quadrant per digit

This is the PHP implementation, one language directory of the Sigil repo; the spec it implements is SPEC.md.

Requires PHP 8.1+. No runtime dependencies. The package ships model.json, the declarative definition it loads, so it works with nothing else installed.

Use it

One Encoder resolves a number into a list of line segments. Each renderer draws that same list in one format — so the three sections below differ only in which renderer you construct.

ASCII — terminals, logs, commit messages

Draws on its own small integer grid (4 cells per quadrant by default), with Bresenham stepping for the diagonals.

Read it by quadrant: top-right is ones, top-left tens, bottom-right hundreds, bottom-left thousands. Widen it with new AsciiRenderer($encoder, cells: 6).

SVG — the web

One <line> per segment plus the stem, drawn slightly heavier. The viewBox is derived from the coordinates, so it stays correct at any geometry.

Pass stroke: 'currentColor' to inherit the surrounding text colour, so the glyph themes itself:

DXF — laser cutters and CNC

Minimal AutoCAD R12, LINE entities only. Y is negated: CAD Y grows upward and the encoder's grows downward, so a straight copy would come off the bed upside down.

One caveat that only matters on a real machine: quadrants meeting at the vertical midpoint share an edge, so tens.bottom and thousands.top are the same line and both are emitted. Invisible on screen; a doubled pass on a laser. examples/04-laser-cutting.php detects and strips them.

Numbers past 9999

Four places is the historical Cistercian system, not a limit of the geometry. A place is a side of the stem and a row down it, so a taller stem holds more digits — as one mark, not several glyphs side by side.

9999 at two rows, through 1234567890 at five rows, each taller than the last

The default stays rows: 2 on purpose: it is the historical system, it is what the golden vectors pin, and a fixed height keeps a set of glyphs visually uniform — an avatar grid where each glyph is a different height is worse than one that throws.

The range is derived from the number of places, never declared, so it cannot disagree with them. That matters: on a four-place glyph 12345 would render identically to 2345, silently losing its leading digit. Hence:

The ceiling is 18 places (9 rows). Past that 10^n - 1 exceeds an exact integer, so the encoder refuses rather than rounding.

CLI

Examples

examples/ has four runnable, self-contained programs — input, output and implementation for each:

01-basics.php The whole API — number in, segment list out, three renderers over the same list
02-avatar-fingerprint.php Identicon-style avatars: a stable mark per user, no image files, no uploads
03-wire-format.php Resolve on the server, draw in the browser with no Cistercian logic client-side
04-laser-cutting.php DXF for a laser/CNC, and the doubled-cut gotcha you must handle

Start with examples/README.md, which shows each one's output inline.

Six identicon avatars derived from email addresses

Renderers

Renderer Output
SvgRenderer One <line> per segment plus the stem, drawn slightly heavier. viewBox is derived from the coordinates, so it stays correct for any geometry.
AsciiRenderer Its own small integer grid (4 cells per quadrant by default), Bresenham stepping for the diagonals.
DxfRenderer Minimal R12 LINE entities. Y is negated — CAD Y grows upward, the encoder's Y grows downward, so a straight copy comes off a laser upside down.

Geometry

Defaults come from geometryDefaults in model.json — stemHeight=200, quadrantWidth=70, stemX=100, stemTopY=20, the values the golden fixtures were generated with. Override them per instance:

Encoder::stem() returns a positional [x1, y1, x2, y2] array, matching the fixture format.

Architecture

None of these classes contain the digit map. They read model.json — a vendored copy of the canonical definition in the spec repo, which diffs it against every implementation's copy on every build so it cannot drift. Encoder::locateModel() resolves it: SIGIL_MODEL, then beside the package root, then one level up.

Renderers call Encoder::segmentsFor() and Encoder::stem() and nothing else — they never touch SegmentModel or Quadrant. That constraint is what makes new output formats and new language ports cheap, so it is enforced by a test (RendererTest::testRenderersDoNotReachIntoTheNumberLogic), not by review.

Tests

CI runs the suite on PHP 8.1 through 8.4, checks the fixtures are not stale, and executes every example.

The suite that matters is tests/VectorsTest.php: it replays ../fixtures/vectors.json and asserts this implementation reproduces every vector exactly. That is the whole definition of "spec-compliant", and every language implementation in this repo has the equivalent file running against the same JSON.

If the fixtures live somewhere else, point at them:

Changing the glyph

model.json is the one file that defines what a glyph looks like — for this package and every other language implementation. Change it in the spec repo first, then copy it here. The fixtures must be regenerated in the same change:

Commit the regenerated fixtures alongside the change. This is a breaking change for every language implementation at once, not just for PHP.

License

MIT — see LICENSE.


All versions of sigil with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 laxit/sigil contains the following files

Loading the files please wait ...