githubEdit

Quick Start

circle-info

This documentation for fontkitarrow-up-right is created and provided by the Typogramarrow-up-right team. It’s a third-party documentation intended to delve deeper into the fontkit API. For the most accurate information, refer to fontkit’s official documentationarrow-up-right.

Installation

Install via NPM:

npm install fontkit

Load a font

import * as fontkit from 'fontkit';

async function loadFont(url) {
  const response = await fetch(url);
  const arrayBuffer = await response.arrayBuffer();
  const buf = new Uint8Array(arrayBuffer);
  const font = fontkit.create(buf);
  console.log(font)
}

Layout a line of text

const run = font.layout('Hello World!');

Get pathData of a GlyphRun

Last updated

Was this helpful?