PHPackages                             akh/typograf - 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. akh/typograf

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

akh/typograf
============

Типография текста

v0.7.0(1y ago)1925.3k↓14.8%2[1 issues](https://github.com/akhx/typograf/issues)2MITPHPPHP &gt;=7.4

Since May 30Pushed 1y ago3 watchersCompare

[ Source](https://github.com/akhx/typograf)[ Packagist](https://packagist.org/packages/akh/typograf)[ RSS](/packages/akh-typograf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (18)Used By (2)

php Типограф
============

[](#php-типограф)

[![tests](https://github.com/akhx/typograf/actions/workflows/tests.yml/badge.svg)](https://github.com/akhx/typograf/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/dfc8de1923017dedf8a8a3dd3dbd0baa0be56dee70fe3299be0dfa8af88f0a5f/68747470733a2f2f636f6465636f762e696f2f67682f616b68782f7479706f677261662f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/akhx/typograf)

Типографирование текста на php, помогает расставить неразрывные пробелы, правильные кавычки и исправить мелкие опечатки.

Содержание
----------

[](#содержание)

- [Установка](#%D0%A3%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0)
- [Использование](#%D0%98%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5)
- [Правила](docs/RULES.md)

### Установка

[](#установка)

```
composer require akh/typograf
```

### Использование

[](#использование)

```
$t = new \Akh\Typograf\Typograf();
$typoText = $t->apply('"Привет, мир!"');
echo $typoText; //«Привет, мир!»
```

#### Включение и выключение правил

[](#включение-и-выключение-правил)

```
$t = new \Akh\Typograf\Typograf();
// Включить правило
$t->enableRule('Nbsp\ReplaceNbsp');
// Включить все правила в группе
$t->enableRule('Nbsp\*');
// Включить все правила
$t->enableRule('*');

// Отключить правило
$t->disableRule('Nbsp\ReplaceNbsp');
// Отключить все правила в группе
$t->disableRule('Nbsp\*');
// Отключить все правила
$t->disableRule('*');
```

#### Частичное отключение

[](#частичное-отключение)

Чтобы отключить типографирование для участка текста, его нужно оберунть в

```
"Привет"
```

#### Добавление своего правила

[](#добавление-своего-правила)

```
$typo = new \Akh\Typograf\Typograf();
$simpleRule = new class extends \Akh\Typograf\Rule\AbstractRule {
    public $name = 'Замена названия сайта';
    protected $sort = 1000;
    public function handler(string $text): string
    {
        return str_replace('old.ru', 'new.ru', $text);
    }
};

$typo->addRule($simpleRule);
$typo->apply('old.ru'); //new.ru
```

Вдохновление черпается из
-------------------------

[](#вдохновление-черпается-из)

- [Типограф на js](https://github.com/typograf/typograf)
- [Типограф Муравьева](https://github.com/emuravjev/mdash)
- [§ 62. Экранная типографика](https://www.artlebedev.ru/kovodstvo/sections/62/)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

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 ~80 days

Recently: every ~165 days

Total

17

Last Release

527d ago

PHP version history (2 changes)v0.4.6PHP &gt;=7.3

v0.7.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/993a3a845508576b344ef4b6797d3db20e1743c3a990e7729688eaf22ea5dc38?d=identicon)[akhx](/maintainers/akhx)

---

Top Contributors

[![akhx](https://avatars.githubusercontent.com/u/8350412?v=4)](https://github.com/akhx "akhx (44 commits)")

---

Tags

phptypographtypographertypographyphptexttypotypografTypograferTypografy

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[povils/figlet

Figlet text generator - PHP

616.8k4](/packages/povils-figlet)

PHPackages © 2026

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