如何动态加载Typekit字体? [英] How can I load dynamically typekit fonts?

查看:209
本文介绍了如何动态加载Typekit字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以像Google Font API一样动态加载Typekit字体?

Is there a way to load typekit fonts dynamically, much like the Google Font API?

也就是说,如何在每个页面上动态声明字体名称,并仅加载该页面所需的字体,而不是将字体添加到套件中并加载整个套件.

That is, how can I declare dynamically on each page the font name in a css link and load just the font(s) that are required for that page, instead of adding fonts into a kit and the loading the whole kit.

推荐答案

我找到了一个解决方案,将其发布在这里,以防其他人使用:

I have found a solution, posting it here in case it is useful for someone else:

我将使用Typekit API为我的应用程序所需的每种不同组合动态创建一个新的套件"(即javascript文件),而不是将它们全部包含在一个大的套件"中.

I will use the Typekit API to dynamically create a new 'kit' (i.e. javascript file) for every different combination that my app requires, instead of including all of them in one big 'kit'.

请参阅: https://typekit.com/docs/api/kits

仍然感谢您的回答!

这篇关于如何动态加载Typekit字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆