Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
character-map
Advanced tools
A simple command line tool for dumping a UTF-8 string of characters supported by a font file
A simple command line tool for dumping a UTF-8 string of characters supported by a font file.
Unicode fonts are usually too large to be embedded as webfont: subsetting is necessary to get them into a reasonable size, especially for CJK fonts.
But which ones do you subset to ensure your design look consistent? There are 2 major approaches:
I prefer the latter approach, because it's a lot easier to optimize and has less of an impact to performance.
And Apple agrees, their sites for China Mainland, Hong Kong and Japan all use this approach.
But I wonder what characters they pick for their CJK subsets?
character-map
to the rescue!
npm install character-map -g
TrueType, OpenType, WOFF v1 files are supported at the moment.
$ character-map -f my.ttf > map.txt
map.txt
will contain a list of characters found in the font. Now you can use this result with a subsetting tool like fontmin.
$ fontmin -t `cat map.txt` other.ttf > subset.ttf
Of course you can verify the result with character-map
again.
MIT
Inspired by CharacterMap and uses opentype.js.
v1.1.0
FAQs
A simple command line tool for dumping a UTF-8 string of characters supported by a font file
The npm package character-map receives a total of 0 weekly downloads. As such, character-map popularity was classified as not popular.
We found that character-map demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.