0

I have a multi lingual site using AngularJS I want to load a font using a .woff file, but i don't want to load it every time the site loads, only if it's loaded with the font's specific language. I mean something like that:

function init(lang){
  if(lang == 'eng')
  // Load font here 
}

I can easily use ng-class to take care of applying the font style in my css, so that is not the issue, I worry about loading redundant fonts on other languages and harm my sites loading time.

Thanks

Shai Ben
  • 11
  • 2
  • 1
    Possible duplicate of [Load external font with javascript and jquery](http://stackoverflow.com/questions/7282151/load-external-font-with-javascript-and-jquery) – Lajos Arpad Jun 05 '16 at 09:47
  • @LajosArpad This is not exactly what I need, looking for a more angular friendly solution. – Shai Ben Jun 05 '16 at 13:16

1 Answers1

0

SCSS will help you to make it. Also refer it its same question I found.

@font-face {
font-family: 'Durant';
src: url('../fonts/DurantBold.woff') format('woff');
font-weight: bold;
}
Akib Bagwan
  • 138
  • 1
  • 2
  • 14