2017 © Pedro Peláez
 

library php-typography

A PHP library for improving your web typography

image

mundschenk-at/php-typography

A PHP library for improving your web typography

  • Thursday, May 10, 2018
  • by Der Mundschenk & Compagnie
  • Repository
  • 2 Watchers
  • 9 Stars
  • 12,453 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 27 Versions
  • 42 % Grown

The README.md

PHP-Typography

Build Status Latest Stable Version Quality Gate Status Coverage License, (*1)

A PHP library for improving your web typography:, (*2)

  • Hyphenation — over 50 languages supported
  • Space control, including:
    • widow protection
    • gluing values to units
    • forced internal wrapping of long URLs & email addresses
  • Intelligent character replacement, including smart handling of:
    • quote marks (‘single’, “double”)
    • dashes ( – )
    • ellipses (…)
    • trademarks, copyright & service marks (™ ©)
    • math symbols (5×5×5=53)
    • fractions (116)
    • ordinal suffixes (1st, 2nd)
  • CSS hooks for styling:
    • ampersands,
    • uppercase words,
    • numbers,
    • initial quotes & guillemets.

Requirements

  • PHP 7.4.0 or above
  • The mbstring extension

Installation

The best way to use this package is through Composer:, (*3)

$ 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., (*4)

License

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

The Versions

27/08 2017

dev-add-swiss-german

dev-add-swiss-german

A PHP library for improving your web typography

  Sources   Download

GPL 2.0+

The Requires

 

The Development Requires

26/08 2017
13/08 2017
10/08 2017

v5.0.0-beta.1

5.0.0.0-beta1

A PHP library for improving your web typography

  Sources   Download

GPL 2.0+

The Requires

 

The Development Requires