font-spider按需生成字体文件

font-spider可以全局安装,也可以单个项目内安装,使用npm run xxxx的形式

复制代码
npm i font-spider
"dev": "font-spider ./*.html"
复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /*声明 WebFont*/
                @font-face {
                font-family: 'happy-font';

                src:url('./zz.ttf') format('truetype');
                }
                .cd{font-family: 'happy-font';}
    </style>
</head>
<body>
  <div class="cd">字</div>
  <div class="">字</div>
</body>
</html>

运行npm run dev后,原字体文件会被移动至.font-spider文件夹内

相关推荐
行者-全栈开发1 天前
【供应链攻击】CVE-2026-45321:TanStack供应链攻击漏洞深度解析与修复指南
arcgis
思特奇时空智能2 天前
大规模点要素地图渲染性能优化实践
vue.js·arcgis·性能优化·node.js·html·gis·webgl
上海懒图科技9 天前
工厂厂区电子地图定位导航:厂区人车精准定位,安全合规双保障
前端·arcgis·vue
非科班Java出身GISer13 天前
ArcGIS JS 基础教程(48):SceneView watch 状态监听
arcgis·arcgis js基础·arcgis js入门·arcgis js监听状态·arcgis js监听事件·arcgis js 监听飞行·arcgis js 监听功能
JudithHuang15 天前
React 嵌套路由与布局
前端·react.js·arcgis·react·react router
Dxy123931021617 天前
JS DES 加密详解
开发语言·javascript·arcgis
非科班Java出身GISer19 天前
ArcGIS JS 基础教程(46):编辑要素属性 FeatureForm
arcgis·arcgis js编辑要素·arcgis js 要素·arcgis js要素属性·arcgis js 编辑属性·arcgis js编辑要素属性
梅如你20 天前
ISPRS | 1990-2020年间中国人工林与天然林的空间分布数据
arcgis·gis·遥感
limit007523 天前
公开 WMTS / XYZ 瓦片接入 Cesium:6 类常见问题与排查顺序
chrome·低代码·arcgis·web3·旅游
limit007524 天前
三维模型悬空与切片偏移的排查顺序
低代码·3d·arcgis·web3·安卓·webgl