PHPackages                             mundschenk-at/php-typography - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mundschenk-at/php-typography

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mundschenk-at/php-typography
============================

A PHP library for improving your web typography

v6.7.0(3y ago)78945.6k↓24.1%7[6 issues](https://github.com/mundschenk-at/php-typography/issues)[3 PRs](https://github.com/mundschenk-at/php-typography/pulls)13GPL-2.0-or-laterPHPPHP &gt;=7.4.0CI failing

Since Aug 10Pushed 1y ago5 watchersCompare

[ Source](https://github.com/mundschenk-at/php-typography)[ Packagist](https://packagist.org/packages/mundschenk-at/php-typography)[ RSS](/packages/mundschenk-at-php-typography/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (35)Used By (13)

PHP-Typography
==============

[](#php-typography)

[![Build Status](https://github.com/mundschenk-at/php-typography/actions/workflows/ci.yml/badge.svg)](https://github.com/mundschenk-at/php-typography/actions/workflows/ci.yml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/15f17c3045c26e6964aba00a31dc58c35acb1d72fd22a7d963128038f295387e/68747470733a2f2f706f7365722e707567782e6f72672f6d756e64736368656e6b2d61742f7068702d7479706f6772617068792f762f737461626c65)](https://packagist.org/packages/mundschenk-at/php-typography)[![Quality Gate Status](https://camo.githubusercontent.com/384e8df1bc1f5f4d0f370c5b839c4902defb9662f42a2760bdaff1780ede0ce0/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d756e64736368656e6b2d61745f7068702d7479706f677261706879266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=mundschenk-at_php-typography)[![Coverage](https://camo.githubusercontent.com/f106b20f16b0d7876c3cb959630352e5f3b4a22e36f5bd816f28b4369d7fcd04/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d756e64736368656e6b2d61745f7068702d7479706f677261706879266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=mundschenk-at_php-typography)[![License](https://camo.githubusercontent.com/7156005f7928b2c02efdef7b88c0f19bd3913e3fe03c40f8f10d6367766aa6a0/68747470733a2f2f706f7365722e707567782e6f72672f6d756e64736368656e6b2d61742f7068702d7479706f6772617068792f6c6963656e7365)](https://packagist.org/packages/mundschenk-at/php-typography)

A PHP library for improving your web typography:

- Hyphenation — over 50 languages supported
- Space control, including:
    - widow protection
    - gluing values to units
    - forced internal wrapping of long URLs &amp; email addresses
- Intelligent character replacement, including smart handling of:
    - quote marks (‘single’, “double”)
    - dashes ( – )
    - ellipses (…)
    - trademarks, copyright &amp; service marks (™ ©)
    - math symbols (5×5×5=53)
    - fractions (1⁄16)
    - ordinal suffixes (1st, 2nd)
- CSS hooks for styling:
    - ampersands,
    - uppercase words,
    - numbers,
    - initial quotes &amp; guillemets.

Requirements
------------

[](#requirements)

- PHP 7.4.0 or above
- The `mbstring` extension

Installation
------------

[](#installation)

The best way to use this package is through Composer:

```
$ composer require mundschenk-at/php-typography
$ vendor/bin/update-iana.php
```

Basic Usage
-----------

[](#basic-usage)

1. Create a `Settings` object and enable the fixes you want.
2. Create a `PHP_Typography` instance and use it to process HTML fragments (or whole documents) using your defined settings.

```
$settings = new \PHP_Typography\Settings();
$settings->set_hyphenation( true );
$settings->set_hyphenation_language( 'en-US' );

$typo = new \PHP_Typography\PHP_Typography();

$hyphenated_html = $typo->process( $html_snippet, $settings );
```

Roadmap
-------

[](#roadmap)

Please have a look at [ROADMAP](ROADMAP.md) file for upcoming releases.

License
-------

[](#license)

PHP-Typography is licensed under the GNU General Public License 2 or later - see the [LICENSE](LICENSE) file for details.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance25

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 99.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~268 days

Total

33

Last Release

1281d ago

Major Versions

v5.2.3 → v6.0.02017-12-25

PHP version history (3 changes)v5.0.0-beta.1PHP &gt;=5.6.0

6.6.x-devPHP &gt;=7.2.0

v6.7.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4291c13955e1a8cc80aae357d84fa757e03f856728abe2e081fa3278abdd6a5?d=identicon)[Der Mundschenk &amp; Compagnie](/maintainers/Der%20Mundschenk%20&%20Compagnie)

---

Top Contributors

[![mundschenk-at](https://avatars.githubusercontent.com/u/6943905?v=4)](https://github.com/mundschenk-at "mundschenk-at (1275 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (3 commits)")[![Melindrea](https://avatars.githubusercontent.com/u/1430628?v=4)](https://github.com/Melindrea "Melindrea (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

composer-packagecss-hookshyphenationphpsmartquotestypography

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mundschenk-at-php-typography/health.svg)

```
[![Health](https://phpackages.com/badges/mundschenk-at-php-typography/health.svg)](https://phpackages.com/packages/mundschenk-at-php-typography)
```

###  Alternatives

[lullabot/amp

A set of useful classes and utilities to convert html to AMP html (See https://www.ampproject.org/)

3802.9M10](/packages/lullabot-amp)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[fivefilters/readability.php

A PHP port of Readability.js

311826.8k5](/packages/fivefilters-readabilityphp)[caseyamcl/toc

Simple Table-of-Contents Generator for PHP. Generates TOCs based off H1...H6 tags

92344.9k5](/packages/caseyamcl-toc)[magyarandras/amp-converter

A library to convert HTML articles, blog posts or similar content to AMP (Accelerated Mobile Pages).

65150.3k](/packages/magyarandras-amp-converter)[judev/php-htmltruncator

HTML Truncation library, ported from the html\_truncator rubygem

26286.5k6](/packages/judev-php-htmltruncator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
