Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ The full documentation is published at

## Contributing

Contributions are welcome. Visit the [project on GitHub](https://github.com/ateliersvg/text)
to [report a bug](https://github.com/ateliersvg/text/issues/new),
[suggest a feature](https://github.com/ateliersvg/text/issues/new), or
[open a pull request](https://github.com/ateliersvg/text/pulls).

Before submitting code, run:

```bash
Expand All @@ -159,8 +164,6 @@ Changes to public behaviour need a test and a documentation update.
Bug reports, security disclosures, and contribution guidelines are collected at
[ateliersvg.com/support](https://ateliersvg.com/support/).

Atelier is maintained by Simon André.

## License

Atelier Text is released under the [MIT License](LICENSE).
23 changes: 0 additions & 23 deletions assets/logo/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions assets/logo/mark-mono.svg

This file was deleted.

10 changes: 0 additions & 10 deletions assets/logo/mark.svg

This file was deleted.

7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Map Unicode text to positioned font glyphs, vector outlines, and SVG documents using alto/font and atelier/svg.",
"type": "library",
"license": "MIT",
"homepage": "https://github.com/ateliersvg/text",
"homepage": "https://ateliersvg.com/text/",
"keywords": [
"font",
"glyph",
Expand All @@ -23,7 +23,8 @@
"authors": [
{
"name": "Simon André",
"email": "smn.andre@gmail.com"
"email": "smn.andre@gmail.com",
"homepage": "https://smnandre.dev"
}
],
"minimum-stability": "stable",
Expand Down Expand Up @@ -53,15 +54,13 @@
"sort-packages": true
},
"scripts": {
"coverage": "vendor/bin/phpunit --coverage-text",
"cs": "vendor/bin/php-cs-fixer fix --dry-run --diff --sequential",
"cs:fix": "vendor/bin/php-cs-fixer fix --sequential",
"qa": [
"@cs",
"@sa",
"@test"
],
"rector": "vendor/bin/rector process --dry-run",
"sa": "vendor/bin/phpstan analyse --memory-limit=-1",
"test": "vendor/bin/phpunit"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/outlines.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $path->isEmpty(); // false
| Member | Type | What it is |
|---|---|---|
| `d()` | `string` | every glyph's contours, concatenated, in one `d` attribute |
| `$advanceWidth` | `float` | how far the run advances, including any spacing you asked for |
| `$advanceWidth` | `float` | how far the run advances, including configured spacing |
| `isEmpty()` | `bool` | true when the text produced no glyphs, as an empty string does |

`$advanceWidth` is the value to use when you lay several runs out yourself: it
Expand Down
19 changes: 10 additions & 9 deletions docs/shaping.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ order: 60
# Shaping

Shaping is the step between a string and a set of positioned glyphs: which
glyph each character maps to, and where each one sits. This package ships a
deliberately small implementation of it, and a seam where a real one goes.
glyph each character maps to, and where each one sits. This package provides a
deliberately limited mapper and an interface for replacing it with a full
shaping engine.

## What the built-in mapper does

One direct `cmap` lookup per Unicode codepoint, producing a left-to-right run.
Each glyph gets its advance from the font's metrics, plus whatever
`letterSpacing` and `wordSpacing` you asked for.
Each glyph gets its advance from the font's metrics, plus the configured
`letterSpacing` and `wordSpacing`.

That is the whole algorithm. It is enough for a headline, a chart label, a
watermark, or a social card in a Latin script, which is what the package was
Expand All @@ -27,9 +28,9 @@ built for.
| kerning | reading `GPOS` or `kern` |
| script shaping | per-script rules for Arabic, Devanagari, and others |

None of these is a bug to be fixed later in this class. Each is a body of work
that HarfBuzz exists to do, and pretending otherwise would produce text that
looks right in English and wrong everywhere else.
Complex scripts, bidirectional text, ligatures, kerning, and font fallback
require a full shaping engine such as HarfBuzz. The built-in mapper keeps its
scope explicit instead of approximating those behaviors.

A codepoint the font has no glyph for throws
[`MissingGlyphException`](errors.md) rather than falling back, because falling
Expand Down Expand Up @@ -78,8 +79,8 @@ a ligature is one glyph from two characters, so it has one cluster and no single
codepoint. The built-in mapper never produces that case, but the contract
already allows it.

`TextDirection::RightToLeft` exists in the enum for the same reason. Nothing in
the package emits it yet.
`TextDirection::RightToLeft` is available to custom shapers. The built-in mapper
returns `TextDirection::LeftToRight`.

## Replacing the mapper

Expand Down