Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@canvas-fonts/arial-narrow-bold

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@canvas-fonts/arial-narrow-bold

Arial Narrow Bold font packaged for node-canvas

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26
Maintainers
1
Weekly downloads
 
Created
Source

@canvas-fonts/arial-narrow-bold

Arial Narrow Bold package for canvas

Usage

const { registerFont, createCanvas } = require('canvas');
registerFont(require("@canvas-fonts/arial-narrow-bold"), { family: "Arial Narrow Bold" });
const canvas = createCanvas(400, 48);
const ctx = canvas.getContext('2d');
ctx.font = `24px "Arial Narrow Bold"`;
ctx.fillText("Arial Narrow Bold", 5, 30);
const png = canvas.toBuffer();

Will create this image:

preview

Creating your own Fonts

This font is part of the canvas-fonts collection. To use your own fonts, simply:

  1. Create a new npm package
  2. Add your font file to the same directory as the package.json created in step 1.
  3. Add the following index.js file in that same directory:
// Replace "MyAwesomeFont.ttf" with the filename of your font!
module.exports = require('path').join(__dirname, "MyAwesomeFont.ttf")
  1. Publish to npm!

Keywords

FAQs

Package last updated on 07 Dec 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc