Merge "Update from upstream"

This commit is contained in:
jenkins-bot
2013-04-30 12:55:45 +00:00
committed by Gerrit Code Review

View File

@@ -253,15 +253,15 @@
base = this.repository.base; base = this.repository.base;
version = fontconfig.version; version = fontconfig.version;
versionSuffix = '?version=' + version + '&20120101'; versionSuffix = '?version=' + version + '&20120101';
styleString = '@font-face { font-family: \'' + fontFamily + '\';\\n'; styleString = '@font-face { font-family: \'' + fontFamily + '\';\n';
userAgent = window.navigator.userAgent; userAgent = window.navigator.userAgent;
fontStyle = fontconfig.fontstyle || 'normal'; fontStyle = fontconfig.fontstyle || 'normal';
fontFormats = []; fontFormats = [];
if ( fontconfig.eot ) { if ( fontconfig.eot ) {
styleString += '\\tsrc: url(\'' + base + fontconfig.eot + versionSuffix + '\');\\n'; styleString += '\tsrc: url(\'' + base + fontconfig.eot + versionSuffix + '\');\n';
} }
styleString += '\\tsrc: '; styleString += '\tsrc: ';
// If the font is present locally, use it. // If the font is present locally, use it.
if ( userAgent.match( /Android 2\.3/ ) === null ) { if ( userAgent.match( /Android 2\.3/ ) === null ) {
// Android 2.3.x does not respect local() syntax. // Android 2.3.x does not respect local() syntax.
@@ -269,30 +269,30 @@
styleString += 'local(\'' + fontFamily + '\'),'; styleString += 'local(\'' + fontFamily + '\'),';
} }
if ( fontconfig.woff ) { if ( fontconfig.woff ) {
fontFormats.push( '\\t\\turl(\'' + base + fontconfig.woff + versionSuffix fontFormats.push( '\t\turl(\'' + base + fontconfig.woff + versionSuffix
+ '\') format(\'woff\')' ); + '\') format(\'woff\')' );
} }
if ( fontconfig.svg ) { if ( fontconfig.svg ) {
fontFormats.push( '\\t\\turl(\'' + base + fontconfig.svg + versionSuffix + '#' fontFormats.push( '\t\turl(\'' + base + fontconfig.svg + versionSuffix + '#'
+ fontFamily + '\') format(\'svg\')' ); + fontFamily + '\') format(\'svg\')' );
} }
if ( fontconfig.ttf ) { if ( fontconfig.ttf ) {
fontFormats.push( '\\t\\turl(\'' + base + fontconfig.ttf + versionSuffix fontFormats.push( '\t\turl(\'' + base + fontconfig.ttf + versionSuffix
+ '\') format(\'truetype\')' ); + '\') format(\'truetype\')' );
} }
styleString += fontFormats.join() + ';\\n'; styleString += fontFormats.join() + ';\n';
if ( fontconfig.fontweight ) { if ( fontconfig.fontweight ) {
styleString += '\\tfont-weight:' + fontconfig.fontweight + ';'; styleString += '\tfont-weight:' + fontconfig.fontweight + ';';
} }
styleString += '\\tfont-style:' + fontStyle + ';'; styleString += '\tfont-style:' + fontStyle + ';';
if ( fontconfig.fontweight !== undefined ) { if ( fontconfig.fontweight !== undefined ) {
styleString += '\font-weight:' + fontconfig.fontweight + ';'; styleString += '\tfont-weight:' + fontconfig.fontweight + ';';
} }
if ( fontconfig.fontstyle !== undefined ) { if ( fontconfig.fontstyle !== undefined ) {
styleString += '\\tfont-style:' + fontconfig.fontstyle + ';'; styleString += '\tfont-style:' + fontconfig.fontstyle + ';';
} else { } else {
styleString += '\\tfont-style: normal;'; styleString += '\tfont-style: normal;';
} }
styleString += '}'; styleString += '}';