https://github.com/tinymins/merge-font
Merge Font With Code Point Mapping
https://github.com/tinymins/merge-font
Last synced: 10 months ago
JSON representation
Merge Font With Code Point Mapping
- Host: GitHub
- URL: https://github.com/tinymins/merge-font
- Owner: tinymins
- Created: 2020-04-07T18:21:23.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-10T18:19:16.000Z (almost 6 years ago)
- Last Synced: 2025-02-13T03:51:52.964Z (12 months ago)
- Language: Python
- Size: 112 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Merge Font With Code Point Mapping
This project is building for merge ttf font file with custom code point mapping. Basicly, it supply two cp-mapping mode: zh2Hans and zh2Hant.
Assume that you already got two fonts: Font-Hans.ttf for Simplified Chinese, and Font-Hant for Traditional Chinese.
You can simplely input command to merge all Traditional Chinese characters into font file as Simplified Chinese code point:
```
python merge-font.py Font-Hans.ttf Font-Hant.ttf Hant2Hans output.ttf
```
In oppsite, you can simplely input command to merge all Simplified Chinese characters into font file as Traditional Chinese code point:
```
python merge-font.py Font-Hant.ttf Font-Hans.ttf Hans2Hant output.ttf
```
What's more, there are two extra modes `Hans` and `Hant` mode, which means all Simplified/Traditional Chinese characters will be merged to base.
## Options
### --cmap
You can pass `cmap` version list. By default, all version of cmap will be updated during insertion.
```
--cmap 12
--cmap 4,12
```
### --optimize
You can pass `--optimize` if you want to make your font smaller. This option will remove all empty glyphs from cmap list.
## Notice
Some fonts contains to much code point in low versioned cmap list such as `cmap_format_4`. So font merge may got crashed when trying insert new cmap. If you have this kind of problem, try use `--optimize` option and try again. If the problem is still, try use `--cmap` option to pass specific cmap versions and try again.