css - Language-specific LESS classes which contain @font-faces not working -


i have bilingual site using i18n. i18n attaches classes , tags of site when renders. example, have:

<html class="en">   <body class="i18n-en">   </body> </html> 

and when user switches languages, following renders:

<html class="ar>   <body class="i18n-ar">   </body> </html> 

i've created less file programmatically loads different font replace english default font when arabic version of site loads, follows:

body.i18n-en {     @font-face {         font-family: 'dinalternatebold';         src: url('../fonts/din-alternate-bold.ttf') format('truetype');     } }  body.i18n-ar {     @font-face {         font-family: 'dinalternatebold';         src: url('../fonts/harmattan-regular.woff') format('woff');     } } 

note calling "harmattan-regular.woff" same variable name "din-alternate-bold.ttf", replacement of instance of dinalternatebold on site automatic.

however, not working. whichever font declared later in less file getting loaded page, regardless of class of body. in case presented above, both arabic , english versions of site loading harmattan-regular.woff.

is there fundamental how fonts behave in css/less i'm missing? if so, proper way achieve effect i'm looking for?

it should noted each font does load when used alone—it in combination i'm running problems.

you can try this:

@font-face {     font-family: 'din-alternate-bold';     src: url("../fonts/din-alternate-bold.eot?-gqzqge");     src: url("../fonts/din-alternate-bold.eot?#iefix-gqzqge") format("embedded-opentype"),           url("../fonts/din-alternate-bold.ttf?-gqzqge") format("woff"),           url("../fonts/din-alternate-bold.ttf?-gqzqge") format("truetype"),           url("../fonts/din-alternate-bold.svg?-gqzqge#din-alternate-bold") format("svg");     font-weight: normal;     font-style: normal }  body.i18n-ar {     font-family: 'din-alternate-bold'; } 

you can try generate font here easier , faster way.


Comments

  1. Casino - Joliet, IN - JM Hub
    Casino - Joliet, 원주 출장마사지 IN offers a 군포 출장마사지 variety of games, a 원주 출장샵 variety of table games and a variety of live casino entertainment options. Visit 강원도 출장샵 our casino 울산광역 출장마사지 near you today!

    ReplyDelete

Post a Comment

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -