PHPackages                             parisek/twig-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. [Templating &amp; Views](/categories/templating)
4. /
5. parisek/twig-typography

ActiveLibrary[Templating &amp; Views](/categories/templating)

parisek/twig-typography
=======================

A Twig extension with typography filter

v1.1.0(1y ago)12.4k↓50%1GPL-2.0-or-laterPHP

Since Mar 2Pushed 1y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (3)Versions (6)Used By (1)

Twig Typography Extension
=========================

[](#twig-typography-extension)

Uses [PHP-Typography](https://github.com/mundschenk-at/php-typography) library and exposes it as Twig Extension. See [class-settings.php](https://github.com/mundschenk-at/php-typography/blob/0fa6cf412124171360eebab59ca77769c67c9740/src/class-settings.php#L247) for possible options.

- 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.

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

[](#installation)

Twig Typography Extension can be easily installed using [composer](http://getcomposer.org/)

```
composer require parisek/twig-typography

```

Usage
-----

[](#usage)

```
$twig = new Twig_Environment($loader);
$twig->addExtension(new Parisek\Twig\TypographyExtension(__DIR__ . '/typography.yml'));
```

Template
--------

[](#template)

```
{{ title|typography }}
```

```
{{ "Lorem Ipsum"|typography }}
```

```
{{ title|typography({'set_dewidow': FALSE}) }}
```

```
{% typography %}
  Lorem Ipsum

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ullamcorper semper nunc, a hendrerit leo auctor ultricies.

{% endtypography %}
```

Inspiration
-----------

[](#inspiration)

- [Twig Extension Symfony Bundle](https://github.com/debach/typography-bundle)
- [Twig Typography Drupal Module](https://www.drupal.org/project/twig_typography)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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

Every ~329 days

Total

5

Last Release

585d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f60a7484412a046d60bd8de9c5fb773cd9d59f00a1b455284fa718b786a4d93?d=identicon)[parisek](/maintainers/parisek)

---

Top Contributors

[![parisek](https://avatars.githubusercontent.com/u/10908003?v=4)](https://github.com/parisek "parisek (9 commits)")

---

Tags

phptwigtwig-extensiontypographytwigtypography

### Embed Badge

![Health badge](/badges/parisek-twig-typography/health.svg)

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

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91492.0M315](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36763.2M221](/packages/twig-intl-extra)[rcrowe/twigbridge

Adds the power of Twig to Laravel

9105.9M50](/packages/rcrowe-twigbridge)[twig/string-extra

A Twig extension for Symfony String

22046.0M133](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22918.5M55](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21914.8M162](/packages/symfony-ux-twig-component)

PHPackages © 2026

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