JSPM

@canvas-fonts/partylet-plain

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q37509F

PartyLET-plain font packaged for node-canvas

Package Exports

  • @canvas-fonts/partylet-plain
  • @canvas-fonts/partylet-plain/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@canvas-fonts/partylet-plain) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@canvas-fonts/partylet-plain

PartyLET-plain package for canvas

Usage

const { registerFont, createCanvas } = require('canvas');
registerFont(require("@canvas-fonts/partylet-plain"), { family: "PartyLET-plain" });
const canvas = createCanvas(400, 48);
const ctx = canvas.getContext('2d');
ctx.font = `24px "PartyLET-plain"`;
ctx.fillText("PartyLET-plain", 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!