Allow disabling font support at runtime #12

Closed
rcarver opened this Issue Jul 15, 2010 · 6 comments

Comments

Projects
None yet
4 participants
Contributor

rcarver commented Jul 15, 2010

I propose the following API, which is passed an instance of WFL's UserAgent object and returns a boolean.

WebFont.load({
  enabled: function(userAgent) {
    // No fonts in IE
    return userAgent.getName() != 'MSIE';
  }
});

Thoughts?

mcolyer commented Jul 15, 2010

This should handle all the cases I can think of.

Contributor

rcarver commented Jul 15, 2010

Logically, where should this sit? If you define 'enabled', does it:

  1. Only get called if userAgent.isSupportingWebFont() returns true?
  2. Get called regardless of what userAgent.isSupportingWebFont() returns?

At first I was leaning toward (1), but now I think (2) is better because it gives users an option when new browsers come out that UserAgent may not correctly identify.

mcolyer commented Jul 16, 2010

I would vote for case number 2. I think it sits in front of the whole webfontloader, as there are some platforms people don't want to use webfonts with, at all.

Collaborator

paulirish commented Jul 16, 2010

There seem to be two big use cases, right?

  1. I want to enable a useragent that WFL isn't considering supported.
  2. I want to disable a particular useragent that WFL supports.

What about override instead of enabled?
That seems to more clearly imply that this method is optional and alters default behavior.

Contributor

rcarver commented Jul 16, 2010

1 & 2: yes I think that covers it. I'm sold on the logic to allow both.

override is good. Is it clear enough what override overrides?

mcolyer commented Jul 16, 2010

Ryan I know we talked about this yesterday but what do we do in the Typekit module when the user overrides an unsupported browser?

@bramstein bramstein closed this Feb 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment