angularjsgoogle-font-apiwebfont-loader

Allow user to change font


I have an SVG with text that I am trying to let the user change with a select and options loaded in from google fonts. I am making an $http call to the google font api to get the list of the fonts and all the info that comes with it. I know about google webfontloader (although I am not sure quite how to implement it), but I am still having a difficult time getting the text to change to the appropriate selected font. I am using Angularjs.

For the question; How do I implement the info that I am getting from the API to allow the user to change the font?


Solution

  • Here is a working angular way to allow the user to change the font style using google api jsFiddle.

    Here is some code since I can't post this answer without it.

    var myApp = angular.module('myApp', []);
    

    I used this fiddle as a starting point and changed it from pure javascript into angular.