webfontloader 1.6.20 → 1.6.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 045dc0d32869c460d1990d2ab636909e8c5292ab
4
- data.tar.gz: 4b530af53dd3537f724fc4ee002fd9d76d2e1ca1
3
+ metadata.gz: 9046d641f3267a85be94a324398f6665b3f9d4fb
4
+ data.tar.gz: 36e9de802d1f4fe7d049b535b0bfa9ce2255dddf
5
5
  SHA512:
6
- metadata.gz: b9c2e931db1bcb45c6abd1809fbfc472611c6fb47240ff6a07a69fef231f3f6fc80fe20ee0996fa4dd533f778e564fe838ed563f5d679558d530d5b18841be49
7
- data.tar.gz: 518d8dff500ac25746c9cc77b35373fbda8b0a7ef88948c89c3ca555c91f1ca85408d24081de73370d4666fd305d0a9a2c0d5401d386ce6d29cda32d8a1f3763
6
+ metadata.gz: 22489a637520bbac2e1767fe66acd46f71d579ce2160e9955e7eaa9ab9d6e34bd7696daf05a7edcd4b98edb9f01d2dddbb35d1876ed2fbc07a6e977d2d5ac6d5
7
+ data.tar.gz: 6fbf91c1a8d7dfa32e0f0901339091e4094ec83ae858b1163e05dca99cd2594d2e9d96630a80bb2f580a762640393572a07121cbe080afb6d4f4ffbc8c8c74e8
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ v1.6.21 (February 2, 2016)
2
+
3
+ * Fix bug in Google module that caused non-latin to fail on browsers that
4
+ support the native font loading API.
5
+ * Fix bug in IE8 where font events sometimes failed due to a timing issue.
6
+
1
7
  v1.6.20 (January 4, 2016)
2
8
 
3
9
  * Add all source files to the npm package.
data/README.md CHANGED
@@ -37,6 +37,8 @@ To use the Web Font Loader library, just include it in your page and tell it whi
37
37
 
38
38
  Alternatively, you can link to the latest `1.x` version of the Web Font Loader by using `https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js` as the `script` source. Note that the version in this url is less specific. It will always load the latest `1.x` version, but it also has a shorter cache time to ensure that your page gets updates in a timely manner. For performance reasons, we recommend using an explicit version number (such as `1.4.7`) in urls when using the Web Font Loader in production. You can manually update the Web Font Loader version number in the url when you want to adopt a new version.
39
39
 
40
+ Web Font Loader is also available on the [jsDelivr](http://www.jsdelivr.com/projects/webfontloader) & [CDNJS](https://cdnjs.com/libraries/webfont) CDNs.
41
+
40
42
  It is also possible to use the Web Font Loader asynchronously. For example, to load [Typekit](http://www.typekit.com) fonts asynchronously, you could use the following code.
41
43
 
42
44
  ```html
data/lib/webfontloader.rb CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'webfontloader/modules'
4
4
 
5
5
  module WebFontLoader
6
- VERSION = '1.6.20'
6
+ VERSION = '1.6.21'
7
7
 
8
8
  ProjectRoot = File.expand_path(File.dirname(__FILE__) + "/..")
9
9
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webfontloader",
3
- "version": "1.6.19",
3
+ "version": "1.6.20",
4
4
  "description": "Web Font Loader gives you added control when using linked fonts via @font-face.",
5
5
  "main": "webfontloader.js",
6
6
  "scripts": {
@@ -99,11 +99,11 @@ goog.scope(function () {
99
99
  if (that.document_.addEventListener) {
100
100
  that.document_.addEventListener('DOMContentLoaded', callback);
101
101
  } else {
102
- that.document_.onreadystatechange = function () {
103
- if (that.document_.readyState == 'interactive') {
102
+ that.document_.attachEvent('onreadystatechange', function () {
103
+ if (that.document_.readyState == 'interactive' || that.document_.readyState == 'complete') {
104
104
  callback();
105
105
  }
106
- };
106
+ });
107
107
  }
108
108
  }
109
109
  };
@@ -11,13 +11,12 @@ webfont.modules.google.FontApiParser = function(fontFamilies) {
11
11
  this.fontTestStrings_ = {};
12
12
  };
13
13
 
14
-
15
14
  webfont.modules.google.FontApiParser.INT_FONTS = {
16
15
  'latin': webfont.FontWatchRunner.DEFAULT_TEST_STRING,
17
- 'cyrillic': 'йяЖ',
18
- 'greek': 'αβΣ',
19
- 'khmer': 'កខគ',
20
- 'Hanuman': 'កខគ' // For backward compatibility
16
+ 'cyrillic': '\u0439\u044f\u0416',
17
+ 'greek': '\u03b1\u03b2\u03a3',
18
+ 'khmer': '\u1780\u1781\u1782',
19
+ 'Hanuman': '\u1780\u1781\u1782' // For backward compatibility
21
20
  };
22
21
 
23
22
  webfont.modules.google.FontApiParser.WEIGHTS = {
@@ -24,6 +24,7 @@
24
24
  * @provideGoog
25
25
  */
26
26
 
27
+ var CLOSURE_NO_DEPS = true;
27
28
 
28
29
  /**
29
30
  * @define {boolean} Overridden to true by the compiler when
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'webfontloader'
16
- s.version = '1.6.20'
17
- s.date = '2016-01-04'
16
+ s.version = '1.6.21'
17
+ s.date = '2016-02-02'
18
18
 
19
19
  ## Make sure your summary is short. The description may be as long
20
20
  ## as you like.
@@ -34,7 +34,7 @@ DESC
34
34
  s.homepage = 'http://github.com/typekit/webfontloader'
35
35
 
36
36
  ## License
37
- s.license = "Apache 2.0"
37
+ s.license = "Apache-2.0"
38
38
 
39
39
  ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
40
40
  ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
@@ -59,10 +59,10 @@ DESC
59
59
 
60
60
  ## List your development dependencies here. Development dependencies are
61
61
  ## those that are only needed during development
62
- s.add_development_dependency('rake')
63
- s.add_development_dependency('rack', ["~>1.5.1"])
64
- s.add_development_dependency('sinatra', ["~>1.3.4"])
65
- s.add_development_dependency('vegas', ["~>0.1.11"])
62
+ s.add_development_dependency('rake', '~>0')
63
+ s.add_development_dependency('rack', '~>1.5', '>=1.5.1')
64
+ s.add_development_dependency('sinatra', '~>1.3', '>=1.3.4')
65
+ s.add_development_dependency('vegas', '~>0.1.11')
66
66
 
67
67
  ## Leave this section as-is. It will be automatically generated from the
68
68
  ## contents of your Git repository via the gemspec task. DO NOT REMOVE
data/webfontloader.js CHANGED
@@ -1,4 +1,4 @@
1
- /* Web Font Loader v1.6.20 - (c) Adobe Systems, Google. License: Apache 2.0 */
1
+ /* Web Font Loader v1.6.21 - (c) Adobe Systems, Google. License: Apache 2.0 */
2
2
  (function(){function aa(a,b,c){return a.call.apply(a.bind,arguments)}function ba(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function p(a,b,c){p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return p.apply(null,arguments)}var q=Date.now||function(){return+new Date};function ca(a,b){this.a=a;this.m=b||a;this.c=this.m.document}var da=!!window.FontFace;function t(a,b,c,d){b=a.c.createElement(b);if(c)for(var e in c)c.hasOwnProperty(e)&&("style"==e?b.style.cssText=c[e]:b.setAttribute(e,c[e]));d&&b.appendChild(a.c.createTextNode(d));return b}function u(a,b,c){a=a.c.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(c,a.lastChild)}function v(a){a.parentNode&&a.parentNode.removeChild(a)}
3
3
  function w(a,b,c){b=b||[];c=c||[];for(var d=a.className.split(/\s+/),e=0;e<b.length;e+=1){for(var f=!1,g=0;g<d.length;g+=1)if(b[e]===d[g]){f=!0;break}f||d.push(b[e])}b=[];for(e=0;e<d.length;e+=1){f=!1;for(g=0;g<c.length;g+=1)if(d[e]===c[g]){f=!0;break}f||b.push(d[e])}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function y(a,b){for(var c=a.className.split(/\s+/),d=0,e=c.length;d<e;d++)if(c[d]==b)return!0;return!1}
4
4
  function z(a){if("string"===typeof a.f)return a.f;var b=a.m.location.protocol;"about:"==b&&(b=a.a.location.protocol);return"https:"==b?"https:":"http:"}function ea(a){return a.m.location.hostname||a.a.location.hostname}
@@ -12,7 +12,7 @@ function ra(a,b,c,d,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e|
12
12
  n);m.push(r)}for(h=0;h<m.length;h++)m[h].start()}},0)}function qa(a,b,c){var d=[],e=c.timeout;ia(b);var d=ka(a.a,c,a.c),f=new W(a.c,b,e);a.h=d.length;b=0;for(c=d.length;b<c;b++)d[b].load(function(b,c,d){ra(a,f,b,c,d)})};function sa(a,b){this.c=a;this.a=b}function ta(a,b,c){var d=z(a.c);a=(a.a.api||"fast.fonts.net/jsapi").replace(/^.*http(s?):(\/\/)?/,"");return d+"//"+a+"/"+b+".js"+(c?"?v="+c:"")}
13
13
  sa.prototype.load=function(a){function b(){if(e["__mti_fntLst"+c]){var d=e["__mti_fntLst"+c](),g=[],k;if(d)for(var h=0;h<d.length;h++){var m=d[h].fontfamily;void 0!=d[h].fontStyle&&void 0!=d[h].fontWeight?(k=d[h].fontStyle+d[h].fontWeight,g.push(new H(m,k))):g.push(new H(m))}a(g)}else setTimeout(function(){b()},50)}var c=this.a.projectId,d=this.a.version;if(c){var e=this.c.m;B(this.c,ta(this,c,d),function(d){d?a([]):b()}).id="__MonotypeAPIScript__"+c}else a([])};function ua(a,b){this.c=a;this.a=b}ua.prototype.load=function(a){var b,c,d=this.a.urls||[],e=this.a.families||[],f=this.a.testStrings||{},g=new C;b=0;for(c=d.length;b<c;b++)A(this.c,d[b],D(g));var k=[];b=0;for(c=e.length;b<c;b++)if(d=e[b].split(":"),d[1])for(var h=d[1].split(","),m=0;m<h.length;m+=1)k.push(new H(d[0],h[m]));else k.push(new H(d[0]));F(g,function(){a(k,f)})};function va(a,b,c){a?this.c=a:this.c=b+wa;this.a=[];this.f=[];this.g=c||""}var wa="//fonts.googleapis.com/css";function xa(a,b){for(var c=b.length,d=0;d<c;d++){var e=b[d].split(":");3==e.length&&a.f.push(e.pop());var f="";2==e.length&&""!=e[1]&&(f=":");a.a.push(e.join(f))}}
14
14
  function ya(a){if(0==a.a.length)throw Error("No fonts to load!");if(-1!=a.c.indexOf("kit="))return a.c;for(var b=a.a.length,c=[],d=0;d<b;d++)c.push(a.a[d].replace(/ /g,"+"));b=a.c+"?family="+c.join("%7C");0<a.f.length&&(b+="&subset="+a.f.join(","));0<a.g.length&&(b+="&text="+encodeURIComponent(a.g));return b};function za(a){this.f=a;this.a=[];this.c={}}
15
- var Aa={latin:"BESbswy",cyrillic:"&#1081;&#1103;&#1046;",greek:"&#945;&#946;&#931;",khmer:"&#x1780;&#x1781;&#x1782;",Hanuman:"&#x1780;&#x1781;&#x1782;"},Ba={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},Ca={i:"i",italic:"i",n:"n",normal:"n"},Da=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;
15
+ var Aa={latin:"BESbswy",cyrillic:"\u0439\u044f\u0416",greek:"\u03b1\u03b2\u03a3",khmer:"\u1780\u1781\u1782",Hanuman:"\u1780\u1781\u1782"},Ba={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},Ca={i:"i",italic:"i",n:"n",normal:"n"},Da=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;
16
16
  function Ea(a){for(var b=a.f.length,c=0;c<b;c++){var d=a.f[c].split(":"),e=d[0].replace(/\+/g," "),f=["n4"];if(2<=d.length){var g;var k=d[1];g=[];if(k)for(var k=k.split(","),h=k.length,m=0;m<h;m++){var l;l=k[m];if(l.match(/^[\w-]+$/)){var n=Da.exec(l.toLowerCase());if(null==n)l="";else{l=n[2];l=null==l||""==l?"n":Ca[l];n=n[1];if(null==n||""==n)n="4";else var r=Ba[n],n=r?r:isNaN(n)?"4":n.substr(0,1);l=[l,n].join("")}}else l="";l&&g.push(l)}0<g.length&&(f=g);3==d.length&&(d=d[2],g=[],d=d?d.split(","):
17
17
  g,0<d.length&&(d=Aa[d[0]])&&(a.c[e]=d))}a.c[e]||(d=Aa[e])&&(a.c[e]=d);for(d=0;d<f.length;d+=1)a.a.push(new H(e,f[d]))}};function Fa(a,b){this.c=a;this.a=b}var Ga={Arimo:!0,Cousine:!0,Tinos:!0};Fa.prototype.load=function(a){var b=new C,c=this.c,d=new va(this.a.api,z(c),this.a.text),e=this.a.families;xa(d,e);var f=new za(e);Ea(f);A(c,ya(d),D(b));F(b,function(){a(f.a,f.c,Ga)})};function Ha(a,b){this.c=a;this.a=b}Ha.prototype.load=function(a){var b=this.a.id,c=this.c.m;b?B(this.c,(this.a.api||"https://use.typekit.net")+"/"+b+".js",function(b){if(b)a([]);else if(c.Typekit&&c.Typekit.config&&c.Typekit.config.fn){b=c.Typekit.config.fn;for(var e=[],f=0;f<b.length;f+=2)for(var g=b[f],k=b[f+1],h=0;h<k.length;h++)e.push(new H(g,k[h]));try{c.Typekit.load({events:!1,classes:!1,async:!0})}catch(m){}a(e)}},2E3):a([])};function Ia(a,b){this.c=a;this.f=b;this.a=[]}Ia.prototype.load=function(a){var b=this.f.id,c=this.c.m,d=this;b?(c.__webfontfontdeckmodule__||(c.__webfontfontdeckmodule__={}),c.__webfontfontdeckmodule__[b]=function(b,c){for(var g=0,k=c.fonts.length;g<k;++g){var h=c.fonts[g];d.a.push(new H(h.name,ga("font-weight:"+h.weight+";font-style:"+h.style)))}a(d.a)},B(this.c,z(this.c)+(this.f.api||"//f.fontdeck.com/s/css/js/")+ea(this.c)+"/"+b+".js",function(b){b&&a([])})):a([])};var Y=new pa(window);Y.a.c.custom=function(a,b){return new ua(b,a)};Y.a.c.fontdeck=function(a,b){return new Ia(b,a)};Y.a.c.monotype=function(a,b){return new sa(b,a)};Y.a.c.typekit=function(a,b){return new Ha(b,a)};Y.a.c.google=function(a,b){return new Fa(b,a)};var Z={load:p(Y.load,Y)};"function"===typeof define&&define.amd?define(function(){return Z}):"undefined"!==typeof module&&module.exports?module.exports=Z:(window.WebFont=Z,window.WebFontConfig&&Y.load(window.WebFontConfig));}());
18
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webfontloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.20
4
+ version: 1.6.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Carver
@@ -9,20 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-04 00:00:00.000000000 Z
12
+ date: 2016-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
@@ -30,6 +30,9 @@ dependencies:
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: '1.5'
35
+ - - '>='
33
36
  - !ruby/object:Gem::Version
34
37
  version: 1.5.1
35
38
  type: :development
@@ -37,6 +40,9 @@ dependencies:
37
40
  version_requirements: !ruby/object:Gem::Requirement
38
41
  requirements:
39
42
  - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: '1.5'
45
+ - - '>='
40
46
  - !ruby/object:Gem::Version
41
47
  version: 1.5.1
42
48
  - !ruby/object:Gem::Dependency
@@ -44,6 +50,9 @@ dependencies:
44
50
  requirement: !ruby/object:Gem::Requirement
45
51
  requirements:
46
52
  - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - - '>='
47
56
  - !ruby/object:Gem::Version
48
57
  version: 1.3.4
49
58
  type: :development
@@ -51,6 +60,9 @@ dependencies:
51
60
  version_requirements: !ruby/object:Gem::Requirement
52
61
  requirements:
53
62
  - - ~>
63
+ - !ruby/object:Gem::Version
64
+ version: '1.3'
65
+ - - '>='
54
66
  - !ruby/object:Gem::Version
55
67
  version: 1.3.4
56
68
  - !ruby/object:Gem::Dependency
@@ -192,7 +204,7 @@ files:
192
204
  - webfontloader.js
193
205
  homepage: http://github.com/typekit/webfontloader
194
206
  licenses:
195
- - Apache 2.0
207
+ - Apache-2.0
196
208
  metadata: {}
197
209
  post_install_message:
198
210
  rdoc_options: