Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
A library that delivers a range of glyphs rendered as SDFs (signed distance fields) in a protobuf.
A library that delivers a range of glyphs rendered as SDFs (signed distance fields) in a protocol buffer. We use these encoded glyphs as the basic blocks of font rendering in Mapbox GL. SDF encoding is superior to traditional fonts for our usecase in terms of scaling, rotation, and quickly deriving halos - WebGL doesn't have built-in font rendering, so the decision is between vectorization, which tends to be slow, and SDF generation.
The approach this library takes is to parse and rasterize the font with Freetype (hence the C++ requirement), and then generate a distance field from that rasterized image.
See also TinySDF, which is a faster but less precise approach to generating SDFs for fonts.
By default, installs binaries. On these platforms no external dependencies are needed.
Just run:
npm install
However, other platforms will fall back to a source compile: see building from source for details.
npm install --build-from-source
Building from source should automatically install boost
, freetype
and protozero
locally using mason. These dependencies can be installed manually by running ./scripts/install_deps.sh
.
Run tests with
npm test
If you make any changes to the C++ files in the src/
directory, you'll need to recompile the node bindings (fontnik.node
) before testing locally:
make
See the Makefile
for additional tasks you can run, such as make coverage
.
FAQs
A library that delivers a range of glyphs rendered as SDFs (signed distance fields) in a protobuf.
The npm package fontnik receives a total of 333 weekly downloads. As such, fontnik popularity was classified as not popular.
We found that fontnik demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 28 open source maintainers 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 found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.