Home > eCSStender.font-face.js

eCSStender.font-face.js

ECSStender.font-face.js is a project mainly written in JavaScript, based on the MIT license.

A simplification of @font-face using eCSStender

== ecsstender.font-face.js

Adds support for a simplified @font-face declaration.

== Requirements

If you plan to offer SVG font support, add a svg_id to the eCSStender methods. This svg_id will be automatically appended to ALL svg URLs.

For example:

eCSStender.addMethod('svg_id','mysvgid');

== Use

This extension supports the transformation of a format-agmostic font declaration

@font-face { font-family: 'Comfortaa'; font-weight: normal; src: url('fonts/Comfortaa_Regular'); }

into one that follows Paul Irish's Bulletproof @font-face syntax [1] and that's based on what files have been uploaded to the specified location with the same base filename:

@font-face { font-family: 'Comfortaa'; font-weight: normal; src: url('fonts/Comfortaa_Regular.eot'); src: local('Comfortaa'), url('fonts/Comfortaa_Regular.ttf') format('truetype'), url('fonts/Comfortaa_Regular.otf') format('opentype'), url('fonts/Comfortaa_Regular.svg#mysvgid') format('svg'); }

[1] http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/

== What's new in this release?

See the CHANGELOG file for information on what's new.

== The distribution

Besides the ecsstender.font-face.js file in /src, there's a test tree (/test) included which holds assorted tests.

== Submodules

The following submodules are included in the /test folder and will need updating:

  • eCSStender

To update, run this in the root folder of the project:

$> git submodule init && git submodule update

== License

ecsstender.font-face.js is licensed under the terms of the MIT License, see the included MIT-LICENSE file.