webfontloader 1.0.25 → 1.0.26
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.
- data/CHANGELOG +6 -0
- data/Rakefile +0 -1
- data/lib/webfontloader.rb +1 -1
- data/src/core/fontwatcher.js +5 -0
- data/src/google/fontapiparser.js +1 -1
- data/src/google/lastresortwebkitfontwatchrunner.js +10 -0
- data/src-test/google/fontapiparsertest.js +31 -0
- data/tools/compiler/compiler.jar +0 -0
- data/webfontloader.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
v1.0.26 (February 8, 2012)
|
2
|
+
* Updated the included version of the Closure JS compiler jar to 1741, to handle newer annotation styles.
|
3
|
+
* Added a missing param annotation for the new FontWatcher.watch argument.
|
4
|
+
* Added param annotations for Google's custom FontWatchRunner implementation.
|
5
|
+
* Updated the Google Web Fonts API parser to accept family names with a plus sign.
|
6
|
+
|
1
7
|
v1.0.25 (February 7, 2012)
|
2
8
|
* Updated the user agent parser to recognize Chrome for Android properly as a Chrome browser.
|
3
9
|
|
data/Rakefile
CHANGED
@@ -106,7 +106,6 @@ file "target/webfont.js" => SourceJs + ["target"] do |t|
|
|
106
106
|
["-jar", JsCompilerJar],
|
107
107
|
["--compilation_level", "ADVANCED_OPTIMIZATIONS"],
|
108
108
|
["--js_output_file", t.name],
|
109
|
-
["--output_wrapper_marker", %("#{output_marker}")],
|
110
109
|
["--output_wrapper", %("#{output_wrapper}")],
|
111
110
|
["--warning_level", "VERBOSE"],
|
112
111
|
["--summary_detail_level", "3"]
|
data/lib/webfontloader.rb
CHANGED
data/src/core/fontwatcher.js
CHANGED
@@ -31,6 +31,11 @@ webfont.FontWatcher.DEFAULT_VARIATION = 'n4';
|
|
31
31
|
* of each family to watch. Described with FVD.
|
32
32
|
* @param {Object.<string, string>} fontTestStrings The font test strings for
|
33
33
|
* each family.
|
34
|
+
* @param {function(new:webfont.FontWatchRunner, function(string, string),
|
35
|
+
* function(string, string), webfont.DomHelper,
|
36
|
+
* Object.<string, function(Object): number>,
|
37
|
+
* function(function(), number=), function(): number, string, string,
|
38
|
+
* string=)} fontWatchRunnerCtor The font watch runner constructor.
|
34
39
|
* @param {boolean} last True if this is the last set of families to watch.
|
35
40
|
*/
|
36
41
|
webfont.FontWatcher.prototype.watch = function(fontFamilies, fontDescriptions,
|
data/src/google/fontapiparser.js
CHANGED
@@ -37,7 +37,7 @@ webfont.FontApiParser.prototype.parse = function() {
|
|
37
37
|
|
38
38
|
for (var i = 0; i < length; i++) {
|
39
39
|
var elements = this.fontFamilies_[i].split(":");
|
40
|
-
var fontFamily = elements[0];
|
40
|
+
var fontFamily = elements[0].replace(/\+/g, " ");
|
41
41
|
var variations = ['n4'];
|
42
42
|
|
43
43
|
if (elements.length >= 2) {
|
@@ -1,5 +1,15 @@
|
|
1
1
|
/**
|
2
2
|
* @constructor
|
3
|
+
* @param {function(string, string)} activeCallback
|
4
|
+
* @param {function(string, string)} inactiveCallback
|
5
|
+
* @param {webfont.DomHelper} domHelper
|
6
|
+
* @param {Object.<string, function(Object): number>} fontSizer
|
7
|
+
* @param {function(function(), number=)} asyncCall
|
8
|
+
* @param {function(): number} getTime
|
9
|
+
* @param {string} fontFamily
|
10
|
+
* @param {string} fontDescription
|
11
|
+
* @param {string=} opt_fontTestString
|
12
|
+
* @extends webfont.FontWatchRunner
|
3
13
|
*/
|
4
14
|
webfont.LastResortWebKitFontWatchRunner = function(activeCallback,
|
5
15
|
inactiveCallback, domHelper, fontSizer, asyncCall, getTime, fontFamily,
|
@@ -207,3 +207,34 @@ FontApiParserTest.prototype.testHanumanIsForwardCompatible = function() {
|
|
207
207
|
assertEquals(webfont.FontApiParser.INT_FONTS['khmer'],
|
208
208
|
hanumanTestStrings);
|
209
209
|
};
|
210
|
+
|
211
|
+
FontApiParserTest.prototype.testPlusReplacedWithSpace = function() {
|
212
|
+
var fontFamilies = [ 'Erica+One', 'Droid+Serif::latin',
|
213
|
+
'Yanone+Kaffeesatz:400,700:latin'];
|
214
|
+
var fontApiParser = new webfont.FontApiParser(fontFamilies);
|
215
|
+
|
216
|
+
fontApiParser.parse();
|
217
|
+
var parsedFontFamilies = fontApiParser.getFontFamilies();
|
218
|
+
|
219
|
+
assertEquals(3, parsedFontFamilies.length);
|
220
|
+
assertEquals('Erica One', parsedFontFamilies[0]);
|
221
|
+
assertEquals('Droid Serif', parsedFontFamilies[1]);
|
222
|
+
assertEquals('Yanone Kaffeesatz', parsedFontFamilies[2]);
|
223
|
+
var variations = fontApiParser.getVariations();
|
224
|
+
|
225
|
+
var ericaOne = variations['Erica One'];
|
226
|
+
assertNotNull(ericaOne);
|
227
|
+
assertEquals(1, ericaOne.length);
|
228
|
+
assertEquals('n4', ericaOne[0]);
|
229
|
+
|
230
|
+
var droidSerif = variations['Droid Serif'];
|
231
|
+
assertNotNull(droidSerif);
|
232
|
+
assertEquals(1, droidSerif.length);
|
233
|
+
assertEquals('n4', droidSerif[0]);
|
234
|
+
|
235
|
+
var yanoneKaffeesatz = variations['Yanone Kaffeesatz'];
|
236
|
+
assertNotNull(yanoneKaffeesatz);
|
237
|
+
assertEquals(2, yanoneKaffeesatz.length);
|
238
|
+
assertEquals('n4', yanoneKaffeesatz[0]);
|
239
|
+
assertEquals('n7', yanoneKaffeesatz[1]);
|
240
|
+
};
|
data/tools/compiler/compiler.jar
CHANGED
Binary file
|
data/webfontloader.gemspec
CHANGED
@@ -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.0.
|
17
|
-
s.date = '2012-02-
|
16
|
+
s.version = '1.0.26'
|
17
|
+
s.date = '2012-02-15'
|
18
18
|
|
19
19
|
## Make sure your summary is short. The description may be as long
|
20
20
|
## as you like.
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webfontloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 35
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 26
|
10
|
+
version: 1.0.26
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Carver
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-02-
|
19
|
+
date: 2012-02-15 00:00:00 -08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|