Download the PHP package nystudio107/php-typography without Composer

On this page you can find all versions of the php package nystudio107/php-typography. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-typography

PhpTypography

PhpTypography is based on the PHP Typography library by KINGdesk. It is extended to support the PSR-0 autoloading standard.

Installation

Install PhpTypography with composer via

composer require debach/php-typography:dev-master
composer install

and then use the class like

$html       = '...';
$typography = new Debach\PhpTypography\PhpTypography();
$prettyHtml = $typography->process($html);

What PhpTypography does

PhpTypography enhances the typography of the text on your web pages. The following table shows some examples of HTML texts before and after processing.

Before After Explanation
explanation ex­pla­na­tion Robust hyphenation with soft hyphens ­. The browser will hyphenate words automatically based on the current line width. This is especially useful where the line width is rather small, for example in multi-column texts (CSS property column-count).
I'm waiting for "Peter" I’m waiting for “Peter” Use correct quotes and apostrophes
... Use the ellipses symbol
A flock of sparrows - some of them juveniles - alighted and sang. A flock of sparrows — some of them juveniles — alighted and sang. Use an em-dash instead of a hypen
14-20 men 14–20 men Use an en-dash instead of a hypen in ranges
Acme Corporation & Partners Acme Corporation <span class="amp">&</span> Partners Ampersands symbols are marked up so that you can choose a different font for them and make them look beatiful. Search the web for “ampersand font” as a start.

For more examples, see the project homepage.

How to use PhpTypography

Construct an instance $typography of Debach\PhpTypography\PhpTypography and call $typography->process($html) on it with the HTML text $html you want to process:

$html       = '<p>I\'m waiting for "Peter"...</p>';
$typography = new Debach\PhpTypography\PhpTypography();
$prettyHtml = $typography->process($html);
echo $prettyHtml;

The above code will print (soft hyphens not shown)

<p>I’m waiting for “Peter”…</p>

By the way, if you’re using the full-stack Symfony framework and Twig, there is also the TypographyBundle which comes with nice little helpers such as the {% typography %} tag and the {{ text|typography }} filter.

Configuration

A thorough explanation of the configuration can be found at the KINGdesk homepage.

Hyphenation depends on the language, which can be set with set_hyphenation_language($languageCode). For example, to set the hyphenation language to French or German, call

$typography->set_hyphenation_language('fr'); // set to French
$typography->set_hyphenation_language('de'); // set to German

The default language is American English. Refer to the filenames in the lang/ directory for an overview of available languages.


All versions of php-typography with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nystudio107/php-typography contains the following files

Loading the files please wait ....