PHPackages                             dd/evolutioncms-snippets-ddtypograph - 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. dd/evolutioncms-snippets-ddtypograph

ActiveModxevo-snippet

dd/evolutioncms-snippets-ddtypograph
====================================

Snippet for text typography. The snippet doesn't use third-party services, also it sends no requests. In other words, everything is performed on your server.

2.7.1(1y ago)0613PHPPHP &gt;=5.6.0

Since May 4Pushed 1y ago2 watchersCompare

[ Source](https://github.com/DivanDesign/EvolutionCMS.snippets.ddTypograph)[ Packagist](https://packagist.org/packages/dd/evolutioncms-snippets-ddtypograph)[ Docs](https://code.divandesign.ru/modx/ddtypograph)[ RSS](/packages/dd-evolutioncms-snippets-ddtypograph/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (1)Versions (9)Used By (3)

(MODX)EvolutionCMS.snippets.ddTypograph
=======================================

[](#modxevolutioncmssnippetsddtypograph)

Snippet for text typography. The snippet doesn’t use third-party services, also it sends no requests. In other words, everything is performed on your server.

You can turn off typography for a text fragment using the `` or `` tags.

Requires
--------

[](#requires)

- PHP &gt;= 5.6
- [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.ru/modx/ddtools) &gt;= 0.48.1
- [PHP.libraries.EMT](http://mdash.ru) 3.5 (contains in archive)

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

[](#installation)

### Using [(MODX)EvolutionCMS.libraries.ddInstaller](https://github.com/DivanDesign/EvolutionCMS.libraries.ddInstaller)

[](#using-modxevolutioncmslibrariesddinstaller)

Just run the following PHP code in your sources or [Console](https://github.com/vanchelo/MODX-Evolution-Ajax-Console):

```
// Include (MODX)EvolutionCMS.libraries.ddInstaller
require_once(
	$modx->getConfig('base_path')
	. 'assets/libs/ddInstaller/require.php'
);

// Install (MODX)EvolutionCMS.snippets.ddTypograph
\DDInstaller::install([
	'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddTypograph',
	'type' => 'snippet',
]);
```

- If `ddTypograph` is not exist on your site, `ddInstaller` will just install it.
- If `ddTypograph` is already exist on your site, `ddInstaller` will check it version and update it if needed.

### Manually

[](#manually)

#### 1. Elements → Snippets: Create a new snippet with the following data

[](#1-elements--snippets-create-a-new-snippet-with-the-following-data)

1. Snippet name: `ddTypograph`.
2. Description: `2.7.1 Snippet for text typography. The snippet doesn’t use third-party services, also it sends no requests. In other words, everything is performed on your server.`.
3. Category: `Core`.
4. Parse DocBlock: `no`.
5. Snippet code (php): Insert content of the `ddTypograph_snippet.php` file from the archive.

#### 2. Elements → Manage Files

[](#2-elements--manage-files)

1. Create a new folder `assets/snippets/ddTypograph/`.
2. Extract the archive to the folder (except `ddTypograph_snippet.php`).

Parameters description
----------------------

[](#parameters-description)

- `text`

    - Description: Text to correct.
    - Valid values: `string`
    - **Required**
- `optAlign`

    - Description: Optical alignment (hanging punctuation).
    - Valid values:
        - `0`
        - `1`
    - Default value: `0`
- `optAlign_useClasses`

    - Description: Use CSS classes instead of inline styles for optical alignment (`` instead of ``).
        If the parameter is enabled, don't forget to specify the following CSS rules on your site: ```
         .oa_obracket_sp_s {margin-right:0.3em;}
         .oa_obracket_sp_b {margin-left:-0.3em;}
         .oa_obracket_nl_b {margin-left:-0.3em;}
         .oa_comma_b {margin-right:-0.2em;}
         .oa_comma_e {margin-left:0.2em;}
         .oa_oquote_nl {margin-left:-0.44em;}
         .oa_oqoute_sp_s {margin-right:0.44em;}
         .oa_oqoute_sp_q {margin-left:-0.44em;}
        ```
    - Valid values:
        - `0`
        - `1`
    - Default value: `0`
- `text_paragraphs`

    - Description: Section signs and line breaks insertion.
    - Valid values:
        - `0`
        - `1`
    - Default value: `0`
- `text_autoLinks`

    - Description: Marking links (including email ones).
    - Valid values:
        - `0`
        - `1`
    - Default value: `0`
- `etc_unicodeConvert`

    - Description: Convert HTML entities into Unicode (`—` instead of `&mdash;`, etc).
    - Valid values:
        - `0`
        - `1`
    - Default value: `1`
- `noTags`

    - Description: Whether HTML element insertion is allowed or not.
        There are cases when using tags causes the text to be invalid, for example, using the snippet inside of an HTML attribute.
    - Valid values:
        - `0`
        - `1`
    - Default value: `0`
- `excludeTags`

    - Description: HTML tags which content will be ignored by snippet.
    - Valid values: `stringCommaSeparated`
    - Default value: `'notg,code'`

Examples
--------

[](#examples)

### Typography the content

[](#typography-the-content)

```
[[ddTypograph? &text=`[*content*]`]]

```

### Typography text with auto paragraphs, links &amp; emails

[](#typography-text-with-auto-paragraphs-links--emails)

```
[[ddTypograph?
	&text=`Some text for typography.`
	&text_paragraphs=`1`
	&text_autoLinks=`1`
]]

```

### Typography text with auto optical margin alignment (hanging quotes &amp; etc)

[](#typography-text-with-auto-optical-margin-alignment-hanging-quotes--etc)

```
[[ddTypograph?
	&text=`Some text for "typography".`
	&optAlign=`1`
]]

```

### Turn off typography for a text fragment (the `` or `` tags)

[](#turn-off-typography-for-a-text-fragment-the-notgnotg-or-span-classnotgspan-tags)

```
[[ddTypograph?
	&text=`Some text. The snippet will not change this text inside the tag. It's easy. Additionally, `span` with the single `notg` class is also supported.`
]]
```

### Run the snippet through `\DDTools\Snippet::runSnippet` without DB and eval

[](#run-the-snippet-through-ddtoolssnippetrunsnippet-without-db-and-eval)

```
\DDTools\Snippet::runSnippet([
	'name' => 'ddTypograph',
	'params' => [
		'text' => "
			There's nothing you can do that can't be done
			Nothing you can sing that can't be sung

			https://en.wikipedia.org/wiki/The_Beatles
		",
		'text_paragraphs' => true,
		'text_autoLinks' => true,
	],
]);
```

Returns:

```
There’s nothing you can do&nbsp;that can’t be&nbsp;done
Nothing you can sing that can’t be&nbsp;sung
en.wikipedia.org/wiki/The_Beatles

```

Links
-----

[](#links)

- [Home page](https://code.divandesign.ru/modx/ddtypograph)
- [Telegram chat](https://t.me/dd_code)
- [Packagist](https://packagist.org/packages/dd/evolutioncms-snippets-ddtypograph)
- [GitHub](https://github.com/DivanDesign/EvolutionCMS.snippets.ddTypograph)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance43

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community14

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

Recently: every ~355 days

Total

7

Last Release

456d ago

PHP version history (2 changes)2.4.1PHP &gt;=5.4.0

2.5.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/09b81986267e62b5fde1473b40aa6f11f7bc26c1c29d5f80f2768c8788e08110?d=identicon)[dd](/maintainers/dd)

---

Top Contributors

[![Ronef](https://avatars.githubusercontent.com/u/1333424?v=4)](https://github.com/Ronef "Ronef (43 commits)")

---

Tags

modxMODX Evoevotypographytypographevolution-cmsmodx evolutionevo cmsevolutioncmsdivandesigndd studiodd groupddtypographtext designtext correctiontext typography

### Embed Badge

![Health badge](/badges/dd-evolutioncms-snippets-ddtypograph/health.svg)

```
[![Health](https://phpackages.com/badges/dd-evolutioncms-snippets-ddtypograph/health.svg)](https://phpackages.com/packages/dd-evolutioncms-snippets-ddtypograph)
```

PHPackages © 2026

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