forked from ngdly/sfnttool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 在TTF字体中提取想要的文字,让字体文件变迷你 | ||
|
||
http://download.csdn.net/detail/ldpjay/8822587 | ||
|
||
【使用】 | ||
1. 确保你的电脑已经安装了Java环境(能运行Java命令),这是必须的。 | ||
|
||
2. 命令行进入到sfnttool所在目录下。(一个小技巧,在当前文件夹里按住Shift再右键,里面有个“在此处打开命令行”。) | ||
|
||
3. 输入下面的命令即可: | ||
|
||
``` | ||
java -jar sfnttool.jar -s '这是一段测试文字' msyh.ttf msyh_simplify.ttf | ||
``` | ||
|
||
sfnttool.jar说明如下: | ||
|
||
``` | ||
java -jar sfnttool.jar -h | ||
subset [-?|-h|-help] [-b] [-s string] fontfile outfile | ||
prototype font subsetter | ||
-?,-help print this help information | ||
-s,-string string to subset | ||
-b,-bench benchmark (run 10000 iterations) | ||
-h,-hints strip hints | ||
-w,-woff output woff format | ||
-e,-eot output eot format | ||
-x,-mtx enable microtype express compression for eot format | ||
``` | ||
|
||
4. 输出字体在同目录下。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>测试</title> | ||
<style type="text/css"> | ||
@font-face { | ||
font-family: "minikatong"; | ||
src: url('sub.eot'); /* IE9*/ | ||
src: url('sub.eot#iefix') format('embedded-opentype'), /* IE6-IE8 */ | ||
/*url('data:application/x-font-woff;charset=utf-8;base64,dsfsafsdaf...') format('woff'),*/ | ||
url('sub.woff') format('woff'), | ||
url('sub.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ | ||
url('sub.svg') format('svg'); /* iOS 4.1- */ | ||
} | ||
|
||
body { | ||
font-family: "minikatong"; | ||
font-size: 30px; | ||
} | ||
.readme { | ||
font-size:20px;font-family:"Microsoft YaHei","SimHei","SimSun"; | ||
background:#ccc;border:1px solid #000;padding:10px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="readme"> | ||
执行命令:<br> | ||
java -jar sfnttool.jar -s '1234567890我要我要啊啊啊' MiNiKaTongJian.ttf sub.ttf | ||
</div> | ||
已提取的文字:1234567890我要我要啊啊啊<br> | ||
未提取的文字:没有提取的哈哈哈 | ||
</body> | ||
|
||
</html> |
Binary file not shown.