免费 · 设计与 CSS
字体格式转换(TTF、OTF、WOFF、WOFF2).
在您的设备上批量转换 TTF、OTF、WOFF 和 WOFF2 字体,并获得可直接粘贴到网站的 @font-face CSS 规则。
Drop fonts here or
TTF, OTF, WOFF or WOFF2 · up to 30 MB each · read on your device, nothing is uploaded
Only the file container changes: TrueType outlines stay TrueType (.ttf) and PostScript/CFF outlines stay CFF (.otf). Converting does not change the font’s licence.
为网站转换字体
- 把 TTF、OTF、WOFF 或 WOFF2 文件拖到页面上,或点击
Choose fonts。 - 选择要生成的格式:网站用 WOFF2,旧浏览器用 WOFF,在电脑上安装用 TTF / OTF。
- 点击
Convert fonts。每个字体的每种格式都有一个下载按钮。 - 点击
Download all + CSS (ZIP),获得全部文件以及包含对应 @font-face 规则的 fonts.css。
示例:629 KB 的 TTF 字体 Noto Sans Regular 转换后约为 200 KB 的 WOFF2 和约 303 KB 的 WOFF。CSS 规则把 WOFF2 放在最前,新版浏览器会下载最小的文件。
哪些会变,哪些不变
只改变文件封装。TrueType 字体仍是 TrueType,CFF(PostScript)字体仍是 CFF,因此 TTF 无法变成真正的 OTF,反之亦然;转换器会自动保留正确的扩展名。不支持字体集合(.ttc)。
转换字体不会改变其许可。限制嵌入的字体会在列表中标出:在网站上使用前请先查看许可。如需查看字体包含的字符,请在字体查看器中打开。
限制与支持格式
输入内容在您的设备上处理。
英语技术说明
Up to 50 fonts of 30 MB each. Only the container changes: TrueType outlines stay TrueType and CFF outlines stay CFF, so TTF cannot become a true OTF or the reverse. Font collections (.ttc) are not supported. Converting does not change the font licence.
WOFF files are written with the W3C WOFF 1.0 layout (zlib per table); WOFF2 uses Google’s encoder and decoder compiled to WebAssembly; font names, weight and style for the CSS come from the font tables (opentype.js). Fonts marked restricted for embedding are flagged.
Noto Sans Regular (629 KB TTF) becomes a 200 KB WOFF2 and a 303 KB WOFF; the CSS rule lists WOFF2 first, then WOFF.
常见问题
网站上应使用哪种格式?
当前浏览器只需 WOFF2;只有需要支持非常旧的浏览器时才加上 WOFF。直接使用生成的 @font-face 规则即可。
我的字体会被上传吗?
不会。WOFF 在浏览器中生成,WOFF2 由在后台 worker 中以 WebAssembly 运行的 Google WOFF2 库生成;文件始终留在您的设备上。
可以把 TTF 转换为 OTF 吗?
文件只能以原有轮廓另存为 TTF 或 OTF。要在 TrueType 和 CFF 之间真正转换轮廓,需要使用字体编辑器。