TTC (True Type Font Collection) to TTF Extraction bash script
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
#!/usr/bin/env bash | |
# depends on: | |
# pip3 install fonttools | |
font="${1}" | |
for n in {1..10} ; do | |
echo $n | |
pyftsubset "${font}" --font-number=${n} \ | |
--output-file="${font%.*}_chinese_only_${n}.ttf" \ | |
--verbose | |
done |
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
#!/usr/bin/env bash | |
# extract only Latin and Chinese unicode ranges from a TTC/TTF font | |
# depends on: | |
# pip3 install fonttools | |
font="${1}" | |
for n in {1..10} ; do | |
echo $n # CHINESE BASIC LATIN BOPOMOFO | |
pyftsubset "${font}" --unicodes=U+4E00-9FFF --unicodes=U+0000-007F --unicodes=U+3100-312F \ | |
--font-number=${n} \ | |
--output-file="${font%.*}_chinese_only_${n}.ttf" \ | |
--verbose | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment