Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.62 KB

File metadata and controls

39 lines (30 loc) · 1.62 KB

fonts

List the local fonts available on this machine (macOS only). These family names are valid fontFamily values on ; each family lists its variants.

MCP tool fonts
CLI dapi fonts [options]

Input

Field Type CLI Description
family string -f, --family <pattern> filter to families whose name contains this (case-insensitive)
weights string[] -w, --weights <weights...> filter to variants with the given CSS weights, e.g. ["400", "700"]
style "normal" | "italic" -s, --style <style> filter to variants with the given style, normal or italic
limit integer -l, --limit <n> return at most this many families (default: 50)

Font families listed here are valid fontFamily values on <text>; see jsx/fonts.md for how a family and variant are named in a composition, and context for the families the open project has actually registered. Runs in the app's main process, so no project needs to be open.

A machine has hundreds of families, so filter by family when looking for one. total counts every family the filters match; when it is larger than families.length, the limit cut the list.

Output

One JSON object:

{
  families: Array<{
    family:   string;
    variants: Array<{
      weight: string;            // CSS weight, e.g. "400"
      style:  "normal" | "italic";
      source: string;            // CSS local() source
    }>;
  }>;
  total: number;                 // families matching the filters, before the limit
}