# fsk-font

> 将AI导出的svg转换为字体的svg

Latest version **2.0.1** (published 2020-10-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install fsk-font
pnpm add fsk-font
yarn add fsk-font
bun add fsk-font
```

Provides the command `fsk-font`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-10-14 |
| First published | 2015-06-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 42.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | xubo |
| Maintainers | xubo, yewumian |
| Keywords | font svg ai2font ai2svg fsk-font |

## Links

- npm: https://www.npmjs.com/package/fsk-font
- Repository: https://github.com/vrxubo/fsk-font
- npm.io page: https://npm.io/package/fsk-font

## Dependencies (7)

- [glob](https://npm.io/package/glob.md) ^7.1.3
- [ramda](https://npm.io/package/ramda.md) ^0.26.1
- [svg2ttf](https://npm.io/package/svg2ttf.md) ~2.0.0
- [ttf2eot](https://npm.io/package/ttf2eot.md) ~1.3.0
- [argparse](https://npm.io/package/argparse.md) ~1.0.2
- [ttf2woff](https://npm.io/package/ttf2woff.md) ~1.3.0
- [svgicons2svgfont](https://npm.io/package/svgicons2svgfont.md) ~1.1.0

## Recent versions

- 2.0.1 (latest) — 2020-10-14
- 2.0.0-beta (beta) — 2018-12-04
- 2.0.0 — 2018-12-17
- 1.0.0 — 2017-06-13
- 0.2.2 — 2016-10-12
- 0.2.1 — 2016-10-12
- 0.2.0 — 2016-10-10
- 0.1.11 — 2016-07-01
- 0.1.10 — 2015-08-14
- 0.1.9 — 2015-07-24
- 0.1.8 — 2015-07-24
- 0.1.7 — 2015-07-14
- 0.1.6 — 2015-07-14
- 0.1.5 — 2015-06-12
- 0.1.4 — 2015-06-12
- … 4 more at https://npm.io/package/fsk-font/versions

## README

# fsk-font #
将使用AI导出的svg文件转换成字体文件
生成.css、.svg、.tff、.woff、.eot等格式文件

## 安装命令 ##
>npm install -g fsk-font

## 示例 ##
>fsk-font

    //直接使用fsk-font命令,将当前命令行所在目录下的svg转换成字体

### 参数说明 ###
>fsk-font -d /svgs  -t /font -D -f h5icon

    此命令会将/svgs目录及其所有子目录下的svg文件转换成字体文件
    -d --dir 目录
    -D --deep 是否扫描-d目录的子目录
    -f --font 字体名字
    -t --target 生成文件的存放目录

    文件存放到/font目录下;
      /font目录的文件:
      --h5icon.eot
      --h5icon.svg
      --h5icon.ttf
      --h5icon.woff

## 配置 ##
    可以通过修改./lib目录下的config.js文件设置生成文件存放目录的方法
    getTargetDir 文件存放目录
    getWebPath   字体文件在线访问URL目录不需要文件名
    getFontName  字体名
    getCssPath   css文件存放目录
    getHtmlPath  css文档html存放目录
    getHtmlWebUrl  访问html的URL
    getCssWebUrl   css文件的在线引用URL便于在html中引用

## 兼容老的字体文件 ##
    为了兼容已有字体文件, 例如原来的css是
    >.icon {
    >  content: 'a';
    >  font-family: custom;
    >}
    现在还想content为a, 不影响之前的css,有两种办法可以实现:
    1 通过文件命名, 将文件命名为:
    custom~a.svg   或 custom~u0061.svg
    custom将作为新的class name a会作为新字体的codepoint
    2 在存放svg文件的目录下创建mapping.json 内容为:
    >{
    >  "custom": "a"
    >}

## svg文件导出格式 ##

Save your file as SVG with the following settings:

* SVG Profiles: SVG 1.1
* Fonts Type: SVG
* Fonts Subsetting: None
* Options Image Location: Embed
* Advanced Options
    * CSS Properties: Presentation Attributes
    * Decimal Places: 1
    * Encoding: UTF-8
    * Output fewer elements: check

请参考[svgicons2svgfont](https://www.npmjs.com/package/svgicons2svgfont)

---
_Source: https://npm.io/package/fsk-font · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
