2017 © Pedro Peláez
 

yii2-extension yii2-webfont-loader

Yii2 Web Font Loader Wrapper

image

mzdani/yii2-webfont-loader

Yii2 Web Font Loader Wrapper

  • Thursday, September 15, 2016
  • by mzdani
  • Repository
  • 0 Watchers
  • 0 Stars
  • 19 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii2 Web Font Loader Wrapper

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist "mzdani/yii2-webfont-loader" "dev-master"

or add, (*4)

"mzdani/yii2-webfont-loader": "dev-master"

to the require section of your composer.json file., (*5)

Usage

Below is some example how to use the wrapper., (*6)

#!php
 false,
    'event'    => false,
    'timeout'  => 2000,
    'context'  => "frames['my-child']",
    'text'     => 'abcdefghijklmnopqrstuvwxyz!',
    'callback' => [
        'loading'      => 'function(){}',
        'active'       => 'function(){}',
        'inactive'     => 'function(){}',
        'fontloading'  => 'function(familyName, fvd) {}',
        'fontactive'   => 'function(familyName, fvd) {console.log(\'font name\'+familyName);}',
        'fontinactive' => 'function(familyName, fvd) {}',
    ],
    'CssFontName' => 'Roboto Condensed',
    'type'        => 'google',
    'families'    => ['Roboto+Condensed:400,700,300:latin'],
]);

WebFontLoader::widget([
    'CssFontName' => 'Roboto Condensed',
    'type'        => 'typekit',
    'families'    => 'xxxx',
]);

WebFontLoader::widget([
    'CssFontName' => 'Roboto Condensed',
    'type'        => 'fontdeck',
    'families'    => 'xxxx',
]);

WebFontLoader::widget([
    'CssFontName' => 'Roboto Condensed',
    'type'        => 'monotype',
    'families'    => [
        'id'  => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
        'ver' => 12345
    ],
]);

?>

You must use CssFontName because the script automatically create <style> to call the font. I use it so I can dynamically change font without editing css file., (*7)

The Versions

15/09 2016

dev-master

9999999-dev

Yii2 Web Font Loader Wrapper

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 google font web font loader

03/01 2016

1.0.0

1.0.0.0

Yii2 Web Font Loader Wrapper

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 google font web font loader