mundschenk-at / php-typography

A PHP library for improving your web typography.
GNU General Public License v2.0
68 stars 6 forks source link
composer-package css-hooks hyphenation php smartquotes typography

PHP-Typography

Build Status Latest Stable Version Quality Gate Status Coverage License

A PHP library for improving your web typography:

Requirements

Installation

The best way to use this package is through Composer:

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

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

Please have a look at ROADMAP file for upcoming releases.

License

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