There is a font is the world's first Chinese web font (online fonts) service platform, the official website written a little bull X
Need to register account before you can use, free font Limited, a page can not exceed 500 words, more than 500 fonts will not add font style for the label, compared to the pit dad!
After trying to use two methods, I share some of my experiences with them.
- Only one font can be loaded
<script src= "Https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js" type= "Text/javascript" charset= "Utf-8" > </script><!--There is only one font that needs to load this js--><script type= "Text/javascript" src= "/HTTP/ Cdn.webfont.youziku.com/wwwroot/js/wf/youziku.client.min.js "></script>
$(function() {Onlyonefont (); }); //returns only one font functionOnlyonefont () {varGETURL = ' Http://service.youziku.com/webFont/getFontFace '; varentity ={url:geturl, AccessKey:' 69C8434454F842F28B46712F1B080C4A ', //This key can be used to return different font names depending on the key, but when using the page, only the ' source simplified ' effect is displayed, and the Content of the problem is not known where :' Test 5555 ', Tag:'. Only-font ' }; $youzikuClient. Getfontface (Entity,function(data) {Console.log (' Get to the font: ' +data. FontFamily); varfontFamily =data. FontFamily; $('. Only-font '). css ({' Font-family ': fontFamily,' Font-size ': ' 24 ', ' Color ': ' #555 ', ' Margin-top ': ' 50px ', ' Margin-left ': ' 100px ' }); }) }
- Lu mode (You can set fonts for different labels at the same time)
// need to load two JS files <script src= "https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js" type= "Text/javascript" charset= "Utf-8" ></script><!--lo-teach mode--<script type= "Text/javascript" src= "/http Cdn.webfont.youziku.com/wwwroot/js/wf/youziku.api.min.js "></script><script type=" Text/javascript " Src= "Https://cdn.webfont.youziku.com/wwwroot/js/wf/youziku.lib.min.js" ></script>
// can set multiple fonts at the same time function Lujiaomode () { $youziku. Load (". Test", "69c8434454f842f28b46712f1b080c4a", "winmantun23001"); $youziku. Load (". Text2", "13e841f53229490490392b9a9c90ea6e", "Hdjxyt"); $youziku. Draw (); }
Also need to use in the again groping, welcome to exchange! There is no more information to share online!
There are font API methods used one or two