Skip to content

Can web font loader provide local fallback if a CDN font fails? #172

Closed
@sciascia

Description

@sciascia

I'm sorry to be posting here but I can't find any info I understand - I have the following which works great:

  <script src="//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script>
  <script>
    WebFont.load({
      google: {
        families: ['Flamenco'],
      },
      custom: {
        families: ['FontAwesome'],
        urls: [ '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css' ]
      }
    });
  </script>

But how do I use the .wf-fontawesome-n4-inactive class that gets added to the html tag to conditionally load a local version? Obviously .wf-fontawesome-n4-inactive @font-face {} makes no sense.

Any pointers in the right direction would be much appreciated.

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions