load_font_async
Load fonts asynchronously in Figma to enhance design workflows, enabling faster integration and smoother performance for AI-assisted design tasks.
Instructions
Load a font asynchronously in Figma
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/talk_to_figma_mcp/tools/text-tools.ts:497-530 (registration)MCP server tool registration for 'load_font_async', including input schema (family: string, style?: string) and proxy handler that sends command to Figma plugin.server.tool( "load_font_async", "Load a font asynchronously in Figma", { family: z.string().describe("Font family name"), style: z.string().optional().describe("Font style (e.g., 'Regular', 'Bold', 'Italic')"), }, async ({ family, style }) => { try { const result = await sendCommandToFigma("load_font_async", { family, style: style || "Regular" }); const typedResult = result as { success: boolean, family: string, style: string, message: string }; return { content: [ { type: "text", text: typedResult.message || `Loaded font ${family} ${style || "Regular"}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error loading font: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- src/claude_mcp_plugin/code.js:2406-2423 (handler)Figma plugin handler for the 'load_font_async' command: loads the specified font using figma.loadFontAsync and returns success/error response.async function loadFontAsyncWrapper(params) { const { family, style = "Regular" } = params || {}; if (!family) { throw new Error("Missing font family"); } try { await figma.loadFontAsync({ family, style }); return { success: true, family: family, style: style, message: `Successfully loaded ${family} ${style}` }; } catch (error) { throw new Error(`Error loading font: ${error.message}`); } }
- src/talk_to_figma_mcp/tools/index.ts:17-17 (registration)Calls registerTextTools(server) which registers the load_font_async tool among other text tools.registerTextTools(server);
- Includes 'load_font_async' in the FigmaCommand type union for TypeScript typing of commands sent to the plugin.| "load_font_async"