webfontloader 1.4.0 → 1.4.1

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.
Files changed (44) hide show
  1. data/CHANGELOG +4 -0
  2. data/lib/webfontloader.rb +1 -1
  3. data/spec/ascender/ascenderscript_spec.js +24 -1
  4. data/spec/core/eventdispatcher_spec.js +15 -11
  5. data/spec/core/font_spec.js +83 -192
  6. data/spec/core/fontruler_spec.js +7 -4
  7. data/spec/core/fontwatcher_spec.js +78 -61
  8. data/spec/core/fontwatchrunner_spec.js +85 -33
  9. data/spec/core/webfont_spec.js +224 -0
  10. data/spec/custom/customcss_spec.js +5 -2
  11. data/spec/deps.js +13 -13
  12. data/spec/fontdeck/fontdeckscript_spec.js +4 -6
  13. data/spec/fonts/sourcesansc.css +1 -0
  14. data/spec/fonts/sourcesanscbold.css +1 -0
  15. data/spec/fonts/sourcesanscbold.otf +0 -0
  16. data/spec/google/fontapiparser_spec.js +58 -178
  17. data/spec/google/googlefontapi_spec.js +14 -42
  18. data/spec/google/lastresortwebkitfontwatchrunner_spec.js +12 -10
  19. data/spec/index.html +5 -3
  20. data/spec/monotype/monotypescript_spec.js +3 -2
  21. data/spec/typekit/typekitscript_spec.js +9 -4
  22. data/src/ascender/ascender_script.js +43 -26
  23. data/src/core/eventdispatcher.js +23 -23
  24. data/src/core/font.js +80 -99
  25. data/src/core/fontmoduleloader.js +1 -1
  26. data/src/core/fontruler.js +10 -20
  27. data/src/core/fontwatcher.js +24 -46
  28. data/src/core/fontwatchrunner.js +13 -13
  29. data/src/core/initialize.js +0 -10
  30. data/src/core/webfont.js +134 -0
  31. data/src/custom/customcss.js +14 -10
  32. data/src/fontdeck/fontdeck_script.js +7 -9
  33. data/src/google/fontapiparser.js +11 -15
  34. data/src/google/googlefontapi.js +1 -2
  35. data/src/google/lastresortwebkitfontwatchrunner.js +15 -13
  36. data/src/modules.yml +2 -3
  37. data/src/monotype/monotype_script.js +9 -8
  38. data/src/typekit/typekit_script.js +17 -7
  39. data/webfontloader.gemspec +7 -6
  40. metadata +9 -8
  41. data/spec/core/cssfontfamilyname_spec.js +0 -38
  42. data/spec/core/fontvariationdescription_spec.js +0 -67
  43. data/src/core/cssfontfamilyname.js +0 -33
  44. data/src/core/fontvariationdescription.js +0 -140
data/src/core/font.js CHANGED
@@ -1,136 +1,117 @@
1
- goog.provide('webfont.WebFont');
2
-
3
- goog.require('webfont.DomHelper');
4
- goog.require('webfont.EventDispatcher');
5
- goog.require('webfont.FontWatcher');
1
+ goog.provide('webfont.Font');
6
2
 
7
3
  /**
8
- * @param {Window} mainWindow The main application window containing
9
- * webfontloader.js.
10
- * @param {webfont.FontModuleLoader} fontModuleLoader A loader instance to use.
11
- * @param {webfont.UserAgent} userAgent The detected user agent to load for.
4
+ * This class is an abstraction for a single font or typeface.
5
+ * It contains the font name and the variation (i.e. style
6
+ * and weight.) A collection Font instances can represent a
7
+ * font family.
8
+ *
12
9
  * @constructor
10
+ * @param {string} name The font family name
11
+ * @param {string=} opt_variation A font variation description
13
12
  */
14
- webfont.WebFont = function(mainWindow, fontModuleLoader, userAgent) {
15
- this.mainWindow_ = mainWindow;
16
- this.fontModuleLoader_ = fontModuleLoader;
17
- this.userAgent_ = userAgent;
18
- this.moduleLoading_ = 0;
19
- this.moduleFailedLoading_ = 0;
13
+ webfont.Font = function (name, opt_variation) {
14
+ this.name_ = name;
15
+ this.weight_ = 4;
16
+ this.style_ = 'n'
17
+
18
+ var variation = opt_variation || 'n4',
19
+ match = variation.match(/^([nio])([1-9])$/i);
20
+
21
+ if (match) {
22
+ this.style_ = match[1];
23
+ this.weight_ = parseInt(match[2], 10);
24
+ }
20
25
  };
21
26
 
22
27
  goog.scope(function () {
23
- var WebFont = webfont.WebFont,
24
- DomHelper = webfont.DomHelper,
25
- EventDispatcher = webfont.EventDispatcher,
26
- FontWatcher = webfont.FontWatcher;
28
+ var Font = webfont.Font;
27
29
 
28
30
  /**
29
- * @param {string} name
30
- * @param {webfont.FontModuleFactory} factory
31
+ * @return {string}
31
32
  */
32
- WebFont.prototype.addModule = function(name, factory) {
33
- this.fontModuleLoader_.addModuleFactory(name, factory);
33
+ Font.prototype.getName = function () {
34
+ return this.name_;
34
35
  };
35
36
 
36
37
  /**
37
- * @param {Object} configuration
38
+ * @return {string}
38
39
  */
39
- WebFont.prototype.load = function(configuration) {
40
- var context = configuration['context'] || this.mainWindow_;
41
- this.domHelper_ = new DomHelper(this.mainWindow_, context);
42
-
43
- var eventDispatcher = new EventDispatcher(
44
- this.domHelper_, context.document.documentElement, configuration);
45
-
46
- if (this.userAgent_.getBrowserInfo().hasWebFontSupport()) {
47
- this.load_(eventDispatcher, configuration);
48
- } else {
49
- eventDispatcher.dispatchInactive();
50
- }
40
+ Font.prototype.getCssName = function () {
41
+ return this.quote_(this.name_);
51
42
  };
52
43
 
53
44
  /**
54
- * @param {webfont.FontModule} module
55
- * @param {webfont.EventDispatcher} eventDispatcher
56
- * @param {webfont.FontWatcher} fontWatcher
57
- * @param {boolean} support
45
+ * @private
46
+ * @param {string} name
47
+ * @return {string}
58
48
  */
59
- WebFont.prototype.isModuleSupportingUserAgent_ = function(module, eventDispatcher,
60
- fontWatcher, support) {
61
- var fontWatchRunnerCtor = module.getFontWatchRunnerCtor ?
62
- module.getFontWatchRunnerCtor() : webfont.FontWatchRunner,
63
- that = this;
64
-
65
- if (!support) {
66
- var allModulesLoaded = --this.moduleLoading_ == 0;
67
-
68
- this.moduleFailedLoading_--;
69
- if (allModulesLoaded) {
70
- if (this.moduleFailedLoading_ == 0) {
71
- eventDispatcher.dispatchInactive();
72
- } else {
73
- eventDispatcher.dispatchLoading();
74
- }
49
+ Font.prototype.quote_ = function (name) {
50
+ var quoted = [];
51
+ var split = name.split(/,\s*/);
52
+ for (var i = 0; i < split.length; i++) {
53
+ var part = split[i].replace(/['"]/g, '');
54
+ if (part.indexOf(' ') == -1) {
55
+ quoted.push(part);
56
+ } else {
57
+ quoted.push("'" + part + "'");
75
58
  }
76
- fontWatcher.watch([], {}, {}, fontWatchRunnerCtor, allModulesLoaded);
77
- return;
78
59
  }
79
-
80
- module.load(function (fontFamilies, fontVariations) {
81
- that.onModuleReady_(eventDispatcher, fontWatcher, fontWatchRunnerCtor, fontFamilies, fontVariations);
82
- });
60
+ return quoted.join(',');
83
61
  };
84
62
 
85
63
  /**
86
- * @param {webfont.EventDispatcher} eventDispatcher
87
- * @param {webfont.FontWatcher} fontWatcher
88
- * @param {function(new:webfont.FontWatchRunner,
89
- * function(string, string),
90
- * function(string, string),
91
- * webfont.DomHelper,
92
- * string,
93
- * string,
94
- * webfont.BrowserInfo,
95
- * number=,
96
- * Object.<string, boolean>=,
97
- * string=)} fontWatchRunnerCtor
98
- * @param {webfont.FontFamilies} fontFamilies
99
- * @param {webfont.FontVariations=} opt_fontVariations
100
- * @param {webfont.FontTestStrings=} opt_fontTestStrings
64
+ * @return {string}
101
65
  */
102
- WebFont.prototype.onModuleReady_ = function(eventDispatcher, fontWatcher,
103
- fontWatchRunnerCtor, fontFamilies, opt_fontVariations, opt_fontTestStrings) {
104
- var allModulesLoaded = --this.moduleLoading_ == 0;
66
+ Font.prototype.getVariation = function () {
67
+ return this.style_ + this.weight_;
68
+ };
105
69
 
106
- if (allModulesLoaded) {
107
- eventDispatcher.dispatchLoading();
70
+ /**
71
+ * @return {string}
72
+ */
73
+ Font.prototype.getCssVariation = function () {
74
+ var style = 'normal',
75
+ weight = this.weight_ + '00';
76
+
77
+ if (this.style_ === 'o') {
78
+ style = 'oblique';
79
+ } else if (this.style_ === 'i') {
80
+ style = 'italic';
108
81
  }
109
82
 
110
- setTimeout(function () {
111
- fontWatcher.watch(fontFamilies, opt_fontVariations || {}, opt_fontTestStrings || {}, fontWatchRunnerCtor, allModulesLoaded);
112
- }, 0);
83
+ return 'font-style:' + style + ';font-weight:' + weight + ';';
113
84
  };
114
85
 
115
86
  /**
116
- * @param {webfont.EventDispatcher} eventDispatcher
117
- * @param {Object} configuration
87
+ * Parses a CSS font declaration and returns a font
88
+ * variation description.
89
+ *
90
+ * @param {string} css
91
+ * @return {string}
118
92
  */
119
- WebFont.prototype.load_ = function(eventDispatcher, configuration) {
120
- var modules = this.fontModuleLoader_.getModules(configuration, this.domHelper_),
121
- timeout = configuration['timeout'],
122
- self = this;
93
+ Font.parseCssVariation = function (css) {
94
+ var weight = 4,
95
+ style = 'n',
96
+ m = null;
123
97
 
124
- this.moduleFailedLoading_ = this.moduleLoading_ = modules.length;
98
+ if (css) {
99
+ m = css.match(/(normal|oblique|italic)/i);
125
100
 
126
- var fontWatcher = new webfont.FontWatcher(this.userAgent_, this.domHelper_, eventDispatcher, timeout);
101
+ if (m && m[1]) {
102
+ style = m[1].substr(0, 1).toLowerCase();
103
+ }
127
104
 
128
- for (var i = 0, len = modules.length; i < len; i++) {
129
- var module = modules[i];
105
+ m = css.match(/([1-9]00|normal|bold)/i);
130
106
 
131
- module.supportUserAgent(this.userAgent_,
132
- goog.bind(this.isModuleSupportingUserAgent_, this, module,
133
- eventDispatcher, fontWatcher));
107
+ if (m && m[1]) {
108
+ if (/bold/i.test(m[1])) {
109
+ weight = 7;
110
+ } else if (/[1-9]00/.test(m[1])) {
111
+ weight = parseInt(m[1].substr(0, 1), 10);
112
+ }
113
+ }
134
114
  }
135
- };
115
+ return style + weight;
116
+ }
136
117
  });
@@ -17,7 +17,7 @@ goog.scope(function () {
17
17
  FontModule.prototype.supportUserAgent = function (userAgent, support) {};
18
18
 
19
19
  /**
20
- * @param {function(webfont.FontFamilies, webfont.FontVariations=, webfont.FontTestStrings=)} onReady
20
+ * @param {function(Array.<webfont.Font>, webfont.FontTestStrings=)} onReady
21
21
  */
22
22
  FontModule.prototype.load = function (onReady) {};
23
23
  });
@@ -1,8 +1,5 @@
1
1
  goog.provide('webfont.FontRuler');
2
2
 
3
- goog.require('webfont.CssFontFamilyName');
4
- goog.require('webfont.FontVariationDescription');
5
-
6
3
  /**
7
4
  * An element that can be used to measure the metrics
8
5
  * of a given font and string.
@@ -10,11 +7,9 @@ goog.require('webfont.FontVariationDescription');
10
7
  * @param {webfont.DomHelper} domHelper
11
8
  * @param {string} fontTestString
12
9
  */
13
- webfont.FontRuler = function(domHelper, fontTestString) {
10
+ webfont.FontRuler = function (domHelper, fontTestString) {
14
11
  this.domHelper_ = domHelper;
15
12
  this.fontTestString_ = fontTestString;
16
- this.nameHelper_ = new webfont.CssFontFamilyName();
17
- this.fvd_ = new webfont.FontVariationDescription();
18
13
  this.el_ = this.domHelper_.createElement('span', {}, this.fontTestString_);
19
14
  };
20
15
 
@@ -22,12 +17,10 @@ goog.scope(function () {
22
17
  var FontRuler = webfont.FontRuler;
23
18
 
24
19
  /**
25
- * @param {string} fontFamily
26
- * @param {string=} opt_fontDescription
20
+ * @param {webfont.Font} font
27
21
  */
28
- FontRuler.prototype.setFont = function(fontFamily, opt_fontDescription) {
29
- var styleString = this.computeStyleString_(fontFamily, opt_fontDescription);
30
- this.domHelper_.setStyle(this.el_, styleString);
22
+ FontRuler.prototype.setFont = function(font) {
23
+ this.domHelper_.setStyle(this.el_, this.computeStyleString_(font));
31
24
  };
32
25
 
33
26
  /**
@@ -39,17 +32,14 @@ goog.scope(function () {
39
32
 
40
33
  /**
41
34
  * @private
42
- * @param {string} fontFamily
43
- * @param {string=} opt_fontDescription
35
+ * @param {webfont.Font} font
44
36
  * @return {string}
45
37
  */
46
- FontRuler.prototype.computeStyleString_ = function(fontFamily, opt_fontDescription) {
47
- var variationCss = opt_fontDescription ? this.fvd_.expand(opt_fontDescription) : '';
48
- var styleString = "position:absolute;top:-999px;left:-999px;" +
49
- "font-size:300px;width:auto;height:auto;line-height:normal;margin:0;" +
50
- "padding:0;font-variant:normal;white-space:nowrap;font-family:" +
51
- this.nameHelper_.quote(fontFamily) + ";" + variationCss;
52
- return styleString;
38
+ FontRuler.prototype.computeStyleString_ = function(font) {
39
+ return "position:absolute;top:-999px;left:-999px;" +
40
+ "font-size:300px;width:auto;height:auto;line-height:normal;margin:0;" +
41
+ "padding:0;font-variant:normal;white-space:nowrap;font-family:" +
42
+ font.getCssName() + ";" + font.getCssVariation();
53
43
  };
54
44
 
55
45
  /**
@@ -20,96 +20,74 @@ webfont.FontWatcher = function(userAgent, domHelper, eventDispatcher, opt_timeou
20
20
  this.browserInfo_ = userAgent.getBrowserInfo();
21
21
  };
22
22
 
23
- /**
24
- * @type {string}
25
- * @const
26
- */
27
- webfont.FontWatcher.DEFAULT_VARIATION = 'n4';
28
-
29
23
  goog.scope(function () {
30
24
  var FontWatcher = webfont.FontWatcher;
31
25
 
32
26
  /**
33
27
  * Watches a set of font families.
34
- * @param {Array.<string>} fontFamilies The font family names to watch.
35
- * @param {Object.<string, Array.<string>>} fontDescriptions The font variations
36
- * of each family to watch. Described with FVD.
28
+ * @param {Array.<webfont.Font>} fonts The fonts to watch.
37
29
  * @param {Object.<string, string>} fontTestStrings The font test strings for
38
30
  * each family.
39
31
  * @param {function(new:webfont.FontWatchRunner,
40
- * function(string, string),
41
- * function(string, string),
32
+ * function(webfont.Font),
33
+ * function(webfont.Font),
42
34
  * webfont.DomHelper,
43
- * string,
44
- * string,
35
+ * webfont.Font,
45
36
  * webfont.BrowserInfo,
46
37
  * number=,
47
38
  * Object.<string, boolean>=,
48
39
  * string=)} fontWatchRunnerCtor The font watch runner constructor.
49
- * @param {boolean} last True if this is the last set of families to watch.
40
+ * @param {boolean} last True if this is the last set of fonts to watch.
50
41
  */
51
- FontWatcher.prototype.watch = function(fontFamilies, fontDescriptions,
42
+ FontWatcher.prototype.watch = function(fonts,
52
43
  fontTestStrings, fontWatchRunnerCtor, last) {
53
- var length = fontFamilies.length;
44
+ var length = fonts.length;
54
45
 
55
- if (length === 0) {
46
+ if (length === 0 && last) {
56
47
  this.eventDispatcher_.dispatchInactive();
57
48
  return;
58
49
  }
59
50
 
60
- for (var i = 0; i < length; i++) {
61
- var fontFamily = fontFamilies[i];
62
- if (!fontDescriptions[fontFamily]) {
63
- fontDescriptions[fontFamily] = [webfont.FontWatcher.DEFAULT_VARIATION];
64
- }
65
- this.currentlyWatched_ += fontDescriptions[fontFamily].length;
66
- }
51
+ this.currentlyWatched_ += length;
67
52
 
68
53
  if (last) {
69
54
  this.last_ = last;
70
55
  }
71
56
 
72
57
  for (var i = 0; i < length; i++) {
73
- var fontFamily = fontFamilies[i];
74
- var descriptions = fontDescriptions[fontFamily];
75
- var fontTestString = fontTestStrings[fontFamily];
58
+ var font = fonts[i];
59
+ var fontTestString = fontTestStrings[font.getName()];
76
60
 
77
- for (var j = 0, len = descriptions.length; j < len; j++) {
78
- var fontDescription = descriptions[j];
61
+ this.eventDispatcher_.dispatchFontLoading(font);
79
62
 
80
- this.eventDispatcher_.dispatchFontLoading(fontFamily, fontDescription);
63
+ var activeCallback = goog.bind(this.fontActive_, this);
64
+ var inactiveCallback = goog.bind(this.fontInactive_, this);
65
+ var fontWatchRunner = new fontWatchRunnerCtor(activeCallback,
66
+ inactiveCallback, this.domHelper_, font,
67
+ this.browserInfo_, this.timeout_, null, fontTestString);
81
68
 
82
- var activeCallback = goog.bind(this.fontActive_, this);
83
- var inactiveCallback = goog.bind(this.fontInactive_, this);
84
- var fontWatchRunner = new fontWatchRunnerCtor(activeCallback,
85
- inactiveCallback, this.domHelper_, fontFamily, fontDescription,
86
- this.browserInfo_, this.timeout_, null, fontTestString);
87
-
88
- fontWatchRunner.start();
89
- }
69
+ fontWatchRunner.start();
90
70
  }
91
71
  };
92
72
 
93
73
  /**
94
74
  * Called by a FontWatchRunner when a font has been detected as active.
95
- * @param {string} fontFamily
96
- * @param {string} fontDescription
75
+ * @param {webfont.Font} font
97
76
  * @private
98
77
  */
99
- FontWatcher.prototype.fontActive_ = function(fontFamily, fontDescription) {
100
- this.eventDispatcher_.dispatchFontActive(fontFamily, fontDescription);
78
+ FontWatcher.prototype.fontActive_ = function(font) {
79
+ this.eventDispatcher_.dispatchFontActive(font);
101
80
  this.success_ = true;
102
81
  this.decreaseCurrentlyWatched_();
103
82
  };
104
83
 
105
84
  /**
106
85
  * Called by a FontWatchRunner when a font has been detected as inactive.
107
- * @param {string} fontFamily
108
- * @param {string} fontDescription
86
+ * @param {webfont.Font} font
109
87
  * @private
110
88
  */
111
- FontWatcher.prototype.fontInactive_ = function(fontFamily, fontDescription) {
112
- this.eventDispatcher_.dispatchFontInactive(fontFamily, fontDescription);
89
+ FontWatcher.prototype.fontInactive_ = function(font) {
90
+ this.eventDispatcher_.dispatchFontInactive(font);
113
91
  this.decreaseCurrentlyWatched_();
114
92
  };
115
93
 
@@ -1,26 +1,25 @@
1
1
  goog.provide('webfont.FontWatchRunner');
2
2
 
3
+ goog.require('webfont.Font');
3
4
  goog.require('webfont.FontRuler');
4
5
 
5
6
  /**
6
7
  * @constructor
7
- * @param {function(string, string)} activeCallback
8
- * @param {function(string, string)} inactiveCallback
8
+ * @param {function(webfont.Font)} activeCallback
9
+ * @param {function(webfont.Font)} inactiveCallback
9
10
  * @param {webfont.DomHelper} domHelper
10
- * @param {string} fontFamily
11
- * @param {string} fontDescription
11
+ * @param {webfont.Font} font
12
12
  * @param {webfont.BrowserInfo} browserInfo
13
13
  * @param {number=} opt_timeout
14
14
  * @param {Object.<string, boolean>=} opt_metricCompatibleFonts
15
15
  * @param {string=} opt_fontTestString
16
16
  */
17
17
  webfont.FontWatchRunner = function(activeCallback, inactiveCallback, domHelper,
18
- fontFamily, fontDescription, browserInfo, opt_timeout, opt_metricCompatibleFonts, opt_fontTestString) {
18
+ font, browserInfo, opt_timeout, opt_metricCompatibleFonts, opt_fontTestString) {
19
19
  this.activeCallback_ = activeCallback;
20
20
  this.inactiveCallback_ = inactiveCallback;
21
21
  this.domHelper_ = domHelper;
22
- this.fontFamily_ = fontFamily;
23
- this.fontDescription_ = fontDescription;
22
+ this.font_ = font;
24
23
  this.fontTestString_ = opt_fontTestString || webfont.FontWatchRunner.DEFAULT_TEST_STRING;
25
24
  this.browserInfo_ = browserInfo;
26
25
  this.lastResortWidths_ = {};
@@ -55,6 +54,7 @@ webfont.FontWatchRunner.DEFAULT_TEST_STRING = 'BESbswy';
55
54
 
56
55
  goog.scope(function () {
57
56
  var FontWatchRunner = webfont.FontWatchRunner,
57
+ Font = webfont.Font,
58
58
  FontRuler = webfont.FontRuler;
59
59
 
60
60
  /**
@@ -67,7 +67,7 @@ goog.scope(function () {
67
67
 
68
68
  for (var font in FontWatchRunner.LastResortFonts) {
69
69
  if (FontWatchRunner.LastResortFonts.hasOwnProperty(font)) {
70
- fontRuler.setFont(FontWatchRunner.LastResortFonts[font], this.fontDescription_);
70
+ fontRuler.setFont(new Font(FontWatchRunner.LastResortFonts[font], this.font_.getVariation()));
71
71
  this.lastResortWidths_[FontWatchRunner.LastResortFonts[font]] = fontRuler.getWidth();
72
72
  }
73
73
  }
@@ -82,8 +82,8 @@ goog.scope(function () {
82
82
 
83
83
  this.started_ = goog.now();
84
84
 
85
- this.fontRulerA_.setFont(this.fontFamily_ + ',' + FontWatchRunner.LastResortFonts.SERIF, this.fontDescription_);
86
- this.fontRulerB_.setFont(this.fontFamily_ + ',' + FontWatchRunner.LastResortFonts.SANS_SERIF, this.fontDescription_);
85
+ this.fontRulerA_.setFont(new Font(this.font_.getName() + ',' + FontWatchRunner.LastResortFonts.SERIF, this.font_.getVariation()));
86
+ this.fontRulerB_.setFont(new Font(this.font_.getName() + ',' + FontWatchRunner.LastResortFonts.SANS_SERIF, this.font_.getVariation()));
87
87
 
88
88
  this.check_();
89
89
  };
@@ -163,7 +163,7 @@ goog.scope(function () {
163
163
  * @return {boolean}
164
164
  */
165
165
  FontWatchRunner.prototype.isMetricCompatibleFont_ = function () {
166
- return this.metricCompatibleFonts_ === null || this.metricCompatibleFonts_.hasOwnProperty(this.fontFamily_);
166
+ return this.metricCompatibleFonts_ === null || this.metricCompatibleFonts_.hasOwnProperty(this.font_.getName());
167
167
  };
168
168
 
169
169
  /**
@@ -205,11 +205,11 @@ goog.scope(function () {
205
205
 
206
206
  /**
207
207
  * @private
208
- * @param {function(string, string)} callback
208
+ * @param {function(webfont.Font)} callback
209
209
  */
210
210
  FontWatchRunner.prototype.finish_ = function(callback) {
211
211
  this.fontRulerA_.remove();
212
212
  this.fontRulerB_.remove();
213
- callback(this.fontFamily_, this.fontDescription_);
213
+ callback(this.font_);
214
214
  };
215
215
  });