From ae912fd0c5b34432898151b44759ace9105c0d19 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Wed, 29 Oct 2014 23:52:01 -0500 Subject: [PATCH] More upstream updates --- afontgarde.js | 11 ++++++----- src/fontfaceonload.js | 13 +++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/afontgarde.js b/afontgarde.js index adb16cd..d8d6a76 100644 --- a/afontgarde.js +++ b/afontgarde.js @@ -3,7 +3,7 @@ * Copyright (c) 2014 Filament Group c/o Zach Leatherman * MIT License */ -/*! fontfaceonload - v0.1.2 - 2014-10-29 +/*! fontfaceonload - v0.1.3 - 2014-10-29 * https://github.com/zachleat/fontfaceonload * Copyright (c) 2014 Zach Leatherman (@zachleat) * MIT License */ @@ -45,8 +45,8 @@ }; FontFaceOnloadInstance.prototype.initialMeasurements = function ( fontFamily ) { - var sansSerif = this.sansSerif; - var serif = this.serif; + var sansSerif = this.sansSerif, + serif = this.serif; this.dimensions = { sansSerif: { @@ -117,8 +117,8 @@ }; // end load() FontFaceOnloadInstance.prototype.init = function( fontFamily, options ) { - var that = this; - var defaultOptions = { + var that = this, + defaultOptions = { glyphs: '', success: function() {}, error: function() {}, @@ -136,6 +136,7 @@ } } + // For some reason this was failing on afontgarde + icon fonts. if( !options.glyphs && "fonts" in doc ) { doc.fonts.load( "1em " + fontFamily ).then(function() { options.success(); diff --git a/src/fontfaceonload.js b/src/fontfaceonload.js index b4fafaa..b002915 100644 --- a/src/fontfaceonload.js +++ b/src/fontfaceonload.js @@ -1,4 +1,4 @@ -/*! fontfaceonload - v0.1.2 - 2014-10-29 +/*! fontfaceonload - v0.1.3 - 2014-10-29 * https://github.com/zachleat/fontfaceonload * Copyright (c) 2014 Zach Leatherman (@zachleat) * MIT License */ @@ -40,8 +40,8 @@ }; FontFaceOnloadInstance.prototype.initialMeasurements = function ( fontFamily ) { - var sansSerif = this.sansSerif; - var serif = this.serif; + var sansSerif = this.sansSerif, + serif = this.serif; this.dimensions = { sansSerif: { @@ -112,8 +112,8 @@ }; // end load() FontFaceOnloadInstance.prototype.init = function( fontFamily, options ) { - var that = this; - var defaultOptions = { + var that = this, + defaultOptions = { glyphs: '', success: function() {}, error: function() {}, @@ -131,7 +131,8 @@ } } - if( "fonts" in doc ) { + // For some reason this was failing on afontgarde + icon fonts. + if( !options.glyphs && "fonts" in doc ) { doc.fonts.load( "1em " + fontFamily ).then(function() { options.success();