Categories > Text > rex_google_webfontloader

Introduction

Loads web font.

Reference: webfontloader

Links


Categories > Text > rex_google_webfontloaderIntroductionLinksDependenceUsageLoad google web fontLoad custom web font

Dependence

None

Usage

This plugin only loads web font ONCE

Load google web font

CallbackYesNoActionis successCondition:On font activeExpression:LastFamilyNameCondition:On activeCondition:On font inactiveExpression:LastFamilyNameCondition:On inactiveAction:GoogleAction:LoadingLoading start----Condition:On loading Condition:On font loadingExpression:LastFamilyName

Sample capx

  1. Action:Google

  2. Action:Loading

    • Condition:On loading

    • Condition:On font loading, when a font is loading started

      • Expression:LastFamilyName
  3. Callback

    • Success :

      • Condition:On font active, when a font is loaded

        • Expression:LastFamilyName
      • Condition:On active, when all fonts are loaded

    • Failed :

      • Condition:On font inactive, when a font loaded failed

        • Expression:LastFamilyName
      • Condition:On inactive, when all fonts loaded failed

Load custom web font

CallbackYesNoYesNoActionis successCondition:On font activeExpression:LastFamilyNameCondition:On activeCondition:On font inactiveExpression:LastFamilyNameCondition:On inactiveStartLoad local fontsPrepare:----Property:API source = LocalAdd file 'webfont.js' in to porjectAction:CustomAction:LoadingLoading start----Condition:On loading Condition:On font loadingExpression:LastFamilyName
  1. Prepare, if loads local fonts

    1. Set property API source to Local

    2. Add file webfont.js into project

      • webfont.js could be found in folder of this plugin
  2. Action:Custom

  3. Action:Loading

    • Condition:On loading

    • Condition:On font loading, when a font is loading started

      • Expression:LastFamilyName
  4. Callback

    • Success :

      • Condition:On font active, when a font is loaded

        • Expression:LastFamilyName
      • Condition:On active, when all fonts are loaded

    • Failed :

      • Condition:On font inactive, when a font loaded failed

        • Expression:LastFamilyName
      • Condition:On inactive, when all fonts loaded failed