npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

font-subset-mcp

v1.0.0

Published

Local font subsetting & conversion MCP server — subset TTF/OTF/WOFF/WOFF2 by characters, convert formats, generate CSS @font-face

Readme

font-subset-mcp

本地字体子集裁剪 & 格式转换 MCP 服务,参考 transfonter.org 功能实现。 完全在本地运行,无需上传文件到外部服务。

快速开始

方式一:通过 npx 运行(推荐)

无需安装,直接在 ~/.cursor/mcp.json 中添加:

{
  "mcpServers": {
    "font-converter": {
      "command": "npx",
      "args": ["-y", "font-subset-mcp"],
      "env": {}
    }
  }
}

方式二:全局安装后运行

npm install -g font-subset-mcp

~/.cursor/mcp.json 中添加:

{
  "mcpServers": {
    "font-converter": {
      "command": "font-subset-mcp",
      "args": [],
      "env": {}
    }
  }
}

提供的工具

| 工具名 | 功能 | |--------|------| | query_font_info | 查询字体元数据(字族名、字形数、文件大小等) | | subset_font_by_characters | 按输入字符裁剪字体,极大减小体积 | | convert_font_format | 字体格式转换(TTF ↔ WOFF ↔ WOFF2) | | generate_font_face_css | 生成 CSS @font-face 规则(支持 base64 内联) | | batch_subset_fonts | 批量裁剪多个字体文件 |

支持格式

  • 输入:.ttf .otf .woff .woff2
  • 输出:ttf woff woff2

使用示例

在 Cursor 对话中直接说:

查询字体信息:/Users/ls/fonts/MyFont.ttf

裁剪字体 /Users/ls/fonts/AlimamaShuHeiTi-Bold.ttf
只保留:你好世界阿里妈妈字体ABC0123456789
输出格式:ttf

为 /Users/ls/fonts/MyFont.ttf 生成 CSS @font-face,font-family 名称:MyFont

发布到 npm

# 构建
npm run build

# 登录 npm
npm login

# 发布
npm publish

本地开发

npm install
npm run build   # 编译 TypeScript
npm start       # 直接运行

性能参考

以阿里妈妈字体(7029 字形,1343 KB)裁剪 30 个常用汉字:

| 指标 | 数值 | |------|------| | 原始大小 | 1343 KB | | 子集大小 | ~5 KB | | 体积减少 | ~99% | | 处理时间 | < 1 秒 |