{"id":18726492,"url":"https://github.com/allanguys/font-spider-plus","last_synced_at":"2025-04-12T16:31:56.184Z","repository":{"id":41186788,"uuid":"126159325","full_name":"allanguys/font-spider-plus","owner":"allanguys","description":"font-spider-plus（字蛛+）是一个智能 WebFont 压缩工具，它能自动分析出本地页面和线上页面使用的 WebFont 并进行按需压缩。","archived":false,"fork":false,"pushed_at":"2023-02-28T00:40:56.000Z","size":2473,"stargazers_count":726,"open_issues_count":10,"forks_count":52,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-12T00:39:17.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allanguys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-21T10:06:40.000Z","updated_at":"2025-04-10T06:31:05.000Z","dependencies_parsed_at":"2024-06-20T23:38:55.495Z","dependency_job_id":null,"html_url":"https://github.com/allanguys/font-spider-plus","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":0.09677419354838712,"last_synced_commit":"f90c078b52612408180e8b6b7b955907ade6ada9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allanguys%2Ffont-spider-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allanguys%2Ffont-spider-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allanguys%2Ffont-spider-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allanguys%2Ffont-spider-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allanguys","download_url":"https://codeload.github.com/allanguys/font-spider-plus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248596571,"owners_count":21130721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T14:14:42.674Z","updated_at":"2025-04-12T16:31:55.496Z","avatar_url":"https://github.com/allanguys.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Fonts"],"sub_categories":[],"readme":"# 字蛛+（Font-spider-Plus）\r**font-spider-plus（字蛛+）是一个智能 WebFont 压缩工具，它能自动分析出本地页面和线上页面使用的 WebFont 并进行按需压缩。**\r\u003cp\u003e\r\t\u003cbr\u003e\r\t\u003cimg src=\"https://raw.githubusercontent.com/allanguys/font-spider-plus/master/README/fsp.gif\" width=\"650\"\u003e\r\t\u003cbr\u003e\r\u003c/p\u003e\r\r## 特性 ##\r\r除了兼容font-spider（[字蛛](https://github.com/aui/font-spider/)）支持的特性：\r\r1. 压缩字体：智能删除没有被使用的字形数据，大幅度减少字体体积\r2. 生成字体：支持 woff2、woff、eot、svg 字体格式生成\r\rfont-spider-plus（字蛛+）还具有以下特性：\r\r1. 支持线上动态渲染的页面\r2. 支持线上GBK编码的文件\r\r## 安装 ##\r``` shell\r    npm i font-spider-plus -g\r``` \r\r\r## 使用范例 ##\r\r### 一、书写 CSS\r出自：[font-spider中文文档](https://github.com/aui/font-spider/blob/master/README-ZH-CN.md \"font-spider中文文档\")\r``` css\r/*声明 WebFont*/\r@font-face {\r  font-family: 'source';\r  src: url('../font/source.eot');\r  src:\r    url('../font/source.eot?#font-spider') format('embedded-opentype'),\r    url('../font/source.woff2') format('woff2'),\r    url('../font/source.woff') format('woff'),\r    url('../font/source.ttf') format('truetype'),\r    url('../font/source.svg') format('svg');\r  font-weight: normal;\r  font-style: normal;\r}\r\r/*使用指定字体*/\r.home h1, .demo \u003e .test {\r    font-family: 'source';\r}\r```\r\r\u003e 特别说明： `@font-face` 中的 `src` 定义的 .ttf 文件必须存在，其余的格式将由工具自动生成\r\r\r\r### 二、压缩本地WebFont\r``` shell\rfsp local [options] \u003chtmlFile1 htmlFile2 ...\u003e\r```\r\u003e 特别说明：htmlFile支持通配符，例如*.htm,*.shtml\r\r### 三、压缩URL中的WebFont\r#### 1、初始化fspconfig文件\r``` shell\rfsp init \r```\r\u003e 在根目录下生成fspconfig.js文件\r\r#### 2、完善fspconfig.js文件\r``` javascript\r{\r    /**\r     * 本地font存放路径\r     * @type    {String}\r     */\r    \"localPath\" : \"../font/\",\r    /**\r     * 线上字体文件路径 (网址中样式文件内font-family的src路径）\r     * @type    {String}\r     */\r    \"onlinePath\" : \"../font/\",\r    /**\r     * URL\r     * @type    {Array\u003cString\u003e}\r     */\r    \"url\" :  [\r    \"http://ieg.tencent.com/\",\r    \"http://game.qq.com/\"\r     ]\r}\r```\r\r#### 3、执行\r``` shell\rfsp run\r```\r\u003e示例文件下载： [Demo.zip ](http://allan5.com/font-spider-plus/assets/demo.zip \"fsp示例文件\")\r\r## 相关链接\r\r\r- [字蛛](https://github.com/aui/font-spider \"font-spider\")\r- [字蛛API](https://github.com/aui/font-spider/blob/master/API.md \"字蛛API\")","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanguys%2Ffont-spider-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallanguys%2Ffont-spider-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanguys%2Ffont-spider-plus/lists"}