gpt4 book ai didi

angular - 在 Angular 中使用字体加载器

转载 作者:行者123 更新时间:2023-12-04 07:04:44 25 4
gpt4 key购买 nike

如何在 Angular 中使用字体加载器,例如 WebFontLoader 或 FontFaceObserver?

我不确定需要导入什么/在哪里以及如何在组件中使用它。

最佳答案

做:npm install webfontloader
然后在你的组件中你可以这样写:

app.component.ts:

import * as WebFont from 'webfontloader';
// ...
ngOnInit(){
WebFont.load({/* your config...*/})
}

关于angular - 在 Angular 中使用字体加载器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53527165/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com