Index: trunk/extensions/WebFonts/js/webfonts.js |
— | — | @@ -183,6 +183,20 @@ |
184 | 184 | }); |
185 | 185 | } |
186 | 186 | }); |
| 187 | + |
| 188 | + //if there are tags with lang attribute, |
| 189 | + $('body').find('*[lang]').each(function(index) { |
| 190 | + //check the availability of font. |
| 191 | + if(languages[this.lang]){ |
| 192 | + //add a font-family style if it does not have any |
| 193 | + if( !this.style.fontFamily) { |
| 194 | + //use the default font, ie the first one. |
| 195 | + fontFamilies.push(languages[this.lang][0]); |
| 196 | + $(this).css('font-family', languages[this.lang][0]); |
| 197 | + } |
| 198 | + } |
| 199 | + }); |
| 200 | + |
187 | 201 | //get unique list |
188 | 202 | fontFamilies = $.unique(fontFamilies); |
189 | 203 | //load css for each of the item in fontfamily list |