Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ngdly committed Aug 15, 2018
1 parent de661c1 commit 04067f4
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 0 deletions.
Binary file added MiNiKaTongJian.ttf
Binary file not shown.
32 changes: 32 additions & 0 deletions README.md
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. 输出字体在同目录下。

37 changes: 37 additions & 0 deletions index.html
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 added sfnttool.jar
Binary file not shown.
Binary file added sub.eot
Binary file not shown.
Binary file added sub.ttf
Binary file not shown.

0 comments on commit 04067f4

Please sign in to comment.