getFont

getFont

Get a specific font from a family by name.

// Get Noto Sans with default weight (400) and normal style
const font = await framer.getFont("Noto Sans")

// Get Noto Sans with a specific weight and style
const font = await framer.getFont("Noto Sans", {
  weight: 800,
  style: "italic"
})

This is not case sensitive. By default, returns a font with normal weight and style. Returns null if the font does not exist or lacks the requested weight/style combination.

Note: Custom fonts are not available to plugins.

Parameters

  • family: string – The font family name (e.g., "Noto Sans").

  • attributes: FontAttributes (optional) – Optional weight and style attributes.

Returns

  • Promise<Font | null> – The matched font or null if not found.