Fix monospace font usage for input fields for latin scripts
Updating jquery.webfonts from upstream Bug: 53734 Change-Id: I58c9c3fb74774e26e0f680cec0b0f9b2d3b2c11c
This commit is contained in:
committed by
Amire80
parent
03e3666ecf
commit
35ac3b972a
@@ -211,16 +211,25 @@
|
|||||||
|
|
||||||
// Load and apply fonts for other language tagged elements (batched)
|
// Load and apply fonts for other language tagged elements (batched)
|
||||||
if ( element.lang && element.lang !== webfonts.language ) {
|
if ( element.lang && element.lang !== webfonts.language ) {
|
||||||
// Child element's language differs from parent.
|
|
||||||
fontFamily = webfonts.getFont( element.lang );
|
fontFamily = webfonts.getFont( element.lang );
|
||||||
|
|
||||||
if ( !fontFamily ) {
|
if ( !fontFamily ) {
|
||||||
// If there is no explicit font for this language, it will
|
// No font preference for the language.
|
||||||
// inherit the webfont for the parent. But that is undesirable here
|
// Check if we need to reset for this language.
|
||||||
// since language is different. So inherit the original font of the
|
// If the font of the parent element, to which webfonts were applied,
|
||||||
// element. Define it explicitly so that inheritance is broken.
|
// remained the same, there is no need to reset.
|
||||||
fontFamily = webfonts.originalFontFamily;
|
if ( webfonts.$element.css( 'fontFamily' ) !== webfonts.originalFontFamily ) {
|
||||||
|
// The parent font changed.
|
||||||
|
// Is there an inheritance?
|
||||||
|
// Is the font for this element the same as parent's font?
|
||||||
|
if ( fontFamilyStyle === webfonts.$element.css( 'fontFamily' ) ) {
|
||||||
|
// Break inheritance of the font from the parent element
|
||||||
|
// by applying the original font to this element
|
||||||
|
fontFamily = webfonts.originalFontFamily;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We do not have fonts for all languages
|
// We do not have fonts for all languages
|
||||||
if ( fontFamily !== null ) {
|
if ( fontFamily !== null ) {
|
||||||
append( fontQueue, fontFamily );
|
append( fontQueue, fontFamily );
|
||||||
@@ -366,8 +375,6 @@
|
|||||||
fontFaceRule += '\tfont-weight:' + fontconfig.fontweight + ';';
|
fontFaceRule += '\tfont-weight:' + fontconfig.fontweight + ';';
|
||||||
}
|
}
|
||||||
|
|
||||||
fontFaceRule += '\tfont-style:' + fontStyle + ';';
|
|
||||||
|
|
||||||
if ( fontconfig.fontweight !== undefined ) {
|
if ( fontconfig.fontweight !== undefined ) {
|
||||||
fontFaceRule += '\tfont-weight:' + fontconfig.fontweight + ';';
|
fontFaceRule += '\tfont-weight:' + fontconfig.fontweight + ';';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user