PHPackages                             phptypography/phptypography - 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. phptypography/phptypography

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

phptypography/phptypography
===========================

PHP Typography is a PHP based solution to greatly improve web typography

v1.21(13y ago)5431GPL-2.0PHPPHP &gt;=5.2.4

Since Mar 23Pushed 13y ago1 watchersCompare

[ Source](https://github.com/adamaveray/PHPTypography)[ Packagist](https://packagist.org/packages/phptypography/phptypography)[ Docs](https://github.com/adamaveray/PHPTypography)[ RSS](/packages/phptypography-phptypography/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP Typography
==============

[](#php-typography)

This is an updated version of the [original PHP Typography project](http://kingdesk.com/projects/php-typography/) by KINGdesk, updated to be PSR-0 compatible and available for use with Composer.

Example Input:

```
This is an example of the PHP Typography project.

It was release in 2009, and helps improve web typography.

It "replaces characters" and adds wrapper spans for adjusting the appearance & style of a page.

```

Example Output:

```
This is an exam­ple of the PHP Typog­ra­phy project.

It was release in 2009, and helps improve web typography.

It “replaces char­ac­ters” and adds wrap­per spans for adjust­ing the appear­ance &amp; style of a page.

```

The original documentation is below.

---

Features
--------

[](#features)

PHP Typography is a PHP based solution to greatly improve web typography. It features the following capabilities (including granular control):

- Hyphenation
- Spacing control, including: gluing values to units, widow protection, and forced internal wrapping of long URLs &amp; email addresses.
- Intelligent character replacement, including smart handling of: quote marks ( “foo” ), dashes ( foo – bar ), ellipses ( … ), trademarks ( ™ ), math symbols ( 1024×768 ), fractions ( 12⁄23 ), and ordinal suffixes ( 3rd )
- CSS hooks for styling: ampersands (class `amp`), acronyms (class `caps`), numbers (class `numbers`), initial single quotes (class `quo`), and initial double quotes &amp; guillemets (class `dquo`).

This project merges, builds upon, and generalizes the functionality of wp-​​Typogrify, wp-​​Hyphenate and SmartyPants.

Implementation
--------------

[](#implementation)

While complication is added when manipulating the many options, implementing PHP Typography can be as easy as this:

```

```

PHP Typography is designed for easy integration with plugin architectures of PHP based content management systems. It has already been ported to WordPress and Zikula CMS. We would like to see other developers pick up this code and implement it for other CMSs. Specifically:

- Drupal
- Joomla
- Expression Engine

If you are a developer for these (or any other PHP based CMS), the heavy lifting is done. You just need to hook it into your CMS.

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

[](#requirements)

PHP Typography has the following requirements:

- The host server must run PHP 5 or later
- Text must be encoded UTF-​​8
- All markup must be valid xHTML, specifically:
    - Every element must be closed,
    - Every attribute must have a value enclosed in quotes, and
    - Tag names and attributes must be lowercase.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

4847d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4642752da07eaa883b2b52b9c69b7d2c44efdc9feffa91d6d36984a6d7090c87?d=identicon)[adamaveray](/maintainers/adamaveray)

---

Top Contributors

[![adamaveray](https://avatars.githubusercontent.com/u/1160237?v=4)](https://github.com/adamaveray "adamaveray (2 commits)")

---

Tags

typography

### Embed Badge

![Health badge](/badges/phptypography-phptypography/health.svg)

```
[![Health](https://phpackages.com/badges/phptypography-phptypography/health.svg)](https://phpackages.com/packages/phptypography-phptypography)
```

###  Alternatives

[jolicode/jolitypo

Microtypography fixer for the web.

3481.1M5](/packages/jolicode-jolitypo)[michelf/php-smartypants

PHP SmartyPants

1115.6M37](/packages/michelf-php-smartypants)[visuellverstehen/statamic-classify

A useful helper to add CSS classes to all HTML tags generated by the bard editor.

20119.8k](/packages/visuellverstehen-statamic-classify)[sunnysideup/typography

Add a typography test page to your silverstripe website / application.

124.4k4](/packages/sunnysideup-typography)

PHPackages © 2026

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