Download the PHP package jolicode/jolitypo without Composer

On this page you can find all versions of the php package jolicode/jolitypo. 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 jolitypo

JoliTypo – Web Microtypography fixer

Finally a tool for typography nerds.

JoliTypo is a tool fixing Microtypography glitches inside your HTML content.

“Tell me Mr. Anderson… what good is a phone call… if you’re unable to speak?”—Agent Smith, Matrix.

It's designed to be:

You can try it with the online demo!

Latest Stable Version

Quick usage

Just tell the Fixer class which Fixer you want to run on your content and then, call fix():

For your ease of use, you can find ready to use list of Fixer for your language here. Micro-typography is nothing like a standard or a law, what really matters is consistency, so feel free to use your own lists.

Please be advised that JoliTypo works best on HTML content; it will also work on plain text, but will be less smart about smart quotes. When fixing a complete HTML document, potential <head>, <html> and <body> tags may be removed.

To fix non HTML content, use the fixString() method:

CLI usage

You can run a standalone version of JoliTypo by downloading the PHAR version

Run jolitypo --help to know how to configure the Fixer.

Installation

Requirements are handled by Composer (libxml and mbstring are required).

Usage outside composer is also possible, just add the src/ directory to any PSR-0 compatible autoloader.

Integrations

Available Fixers

Dash

Replaces the simple dash - by a ndash between numbers (dates ranges...) and the double -- by a mdash .

Dimension

Replaces the letter x between numbers (12 x 123) by a times entity (×, the real mathematical symbol).

Ellipsis

Replaces the three dots ... by an ellipsis .

SmartQuotes

Converts dumb quotes " " to all kinds of smart style quotation marks (“ ”, « », „ “...). Handles a good variety of locales, like English, Arabic, French, Italian, Spanish, Irish, German...

See the code for more details, and do not forget to specify a locale on the Fixer instance.

This Fixer replaces legacy EnglishQuotes, FrenchQuotes and GermanQuotes.

FrenchNoBreakSpace

Replaces some classic spaces by non-breaking spaces following the French typographic code. No break space are placed before :, thin no break space before ;, ! and ?.

NoSpaceBeforeComma

Removes space before , and makes sure there is only one space after.

Hyphen (automatic hyphenation)

Makes use of org_heigl/hyphenator, a tool enabling word-hyphenation in PHP. This Hyphenator uses the pattern-files from OpenOffice which are based on the pattern-files created for TeX.

There are only some locales available for this fixer: af_ZA, ca, da_DK, de_AT, de_CH, de_DE, en_GB, en_UK, et_EE, fr, hr_HR, hu_HU, it_IT, lt_LT, nb_NO, nn_NO, nl_NL, pl_PL, pt_BR, ro_RO, ru_RU, sk_SK, sl_SI, sr, zu_ZA.

You can read more about this fixer on the official github repository.

This Fixer requires a Locale to be set on the Fixer with $fixer->setLocale('fr_FR');. Default to en_GB.

Proper hyphenation is mandatory in justified text and you should avoid word breaking in titles with this line of CSS: hyphens:none;.

⚠ Be aware that the current screen readers are unable to spell correctly the words containing &shy; tags. The Hyphen filter should therefore be used with caution or you might reduce your website's accessibility.

CurlyQuote (Smart Quote)

Replaces straight quotes ' with curly ones . There is one exception to consider: foot and inch marks (minutes and second marks). Purists use prime , this fixer uses straight quotes for compatibility. Read more about Curly quotes.

Trademark

Handles trade­mark symbol , a registered trade­mark symbol ®, and a copy­right symbol ©. This fixer replaces commonly used approximations: (r), (c) and (TM). A non-breaking space is put between numbers and copyright symbols too.

Unit (formerly Numeric)

Adds a non-breaking space between a numeral and its unit. Like this: 12_h, 42_฿ or 88_%. It was named Numeric before release 1.0.2, but BC is kept for now.

It is really easy to make your own Fixers, feel free to extend the provided ones if they do not fit your typographic rules.

Fixer recommendations by locale

en_GB

fr_FR

Those rules apply for most of the recommendations of "Abrégé du code typographique à l'usage de la presse", ISBN: 9782351130667.

fr_CA

Mostly the same as fr_FR, but the space before punctuation points is not mandatory.

de_DE

Mostly the same as en_GB, according to Typefacts and Wikipedia.

More to come (contributions welcome!).

Documentation

Default usage

Define your own Fixer

If you want to add your own Fixer to the list, you have to implement JoliTypo\FixerInterface. Then just give JoliTypo their fully qualified name, or even instance:

Configure the protected tags

Protected tags is a list of HTML tag names that the DOM parser must avoid. Nothing in those tags will be fixed.

Add your own Fixer / Contribute a Fixer

Contribution guidelines

If you add a new Fixer, please provide sources and references about the typographic rule you want to fix.

Compatibility & OS support restrictions

BUT if you use a font (@font-face maybe) that contains all those glyphs, there will be no issues.

There is a known issue preventing JoliTypo to work correctly with APC versions older than 3.1.11.

What can you do to help?

We need to be able to use this tool everywhere, you can help by providing:

Also, there is a Todo list :kissing_smiling_eyes:

License

This piece of code is under MIT License. See the LICENSE file.

Alternatives and other implementations

There is already quite a bunch of tools like this one (including good ones). Sadly, some are only for one language, some are running regexp on the whole HTML code (which is bad), some are not tested, some are bundled inside a CMS or a Library, some are not using proper auto-loading, some do not have an open bug tracker... Have a look by yourself:

Glossary & References

Thanks to theses online resources for helping a developer understand typography:


All versions of jolitypo with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-mbstring Version *
lib-libxml Version *
org_heigl/hyphenator Version ^2.6 || ^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 jolicode/jolitypo contains the following files

Loading the files please wait ....