bricks_get_fonts

Phase 1BeginnerRead OnlyComplexity: 2/10
List all custom fonts registered in Bricks

Overview

Lists all custom fonts registered in Bricks Builder. Returns font family names, variants (weight/style combinations), file URLs for each format (woff2, woff, ttf, otf), and display settings.

Custom fonts are uploaded via bricks_upload_font and stored as a custom post type (bricks_fonts). Each font can have multiple @font-face variants with different weight and style combinations.

Use this tool to check which fonts are available before referencing them in typography settings or global classes.

Key Features

Complete Font Data
Returns font family names, all weight/style variants, file URLs per format (woff2, woff, ttf, otf, eot), and font-display settings.
Variant Details
Each font lists all registered @font-face variants with specific weight (100-900) and style (normal, italic, oblique) values.
No Parameters Needed
Simply call the tool with no arguments to get all registered custom fonts.

When to Use

Checking which custom fonts are available before setting typography
Verifying a font was uploaded successfully after using bricks_upload_font
Auditing font assets to identify unused or redundant font files
Before setting font-family in theme styles or global classes
Prerequisites
Bricks Builder must be installed and activated
Custom fonts must have been uploaded previously via bricks_upload_font or the Bricks UI

When NOT to Use

When you need Google Fonts (these are built into Bricks and loaded separately)
When checking Adobe Fonts configuration (use bricks_set_adobe_fonts to manage those)
When looking for system/web-safe fonts (these do not appear in this list)

Parameters

1 Total Parameters1 Optional
(none)noneoptional
This tool takes no input parameters. It returns all custom fonts (uploaded and Adobe Fonts).

Code Examples

List all custom fonts

Retrieve all registered custom fonts to check availability.

JSON
{}
Response
{
  "data": [
    {
      "font_id": "a1b2c3",
      "font_family": "Inter",
      "font_display": "swap",
      "variants": [
        {
          "weight": "400",
          "style": "normal",
          "files": {
            "woff2": "https://example.com/wp-content/uploads/bricks/fonts/inter-regular.woff2"
          }
        },
        {
          "weight": "700",
          "style": "normal",
          "files": {
            "woff2": "https://example.com/wp-content/uploads/bricks/fonts/inter-bold.woff2"
          }
        }
      ]
    }
  ]
}

Common Mistakes


Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
This tool only returns fonts uploaded via bricks_upload_font. Google Fonts are loaded separately by Bricks and do not appear here.

Tips & Warnings

Tips & Warnings

Tip: After confirming a custom font exists in the list, use its exact font_family name in _typography: { "font-family": "YourFont" } within theme styles or global classes.

Tip: Always prefer woff2 format for best compression and browser support. If only ttf/otf files are available, consider converting to woff2 before uploading.

Return Values

FieldTypeDescription
dataarrayArray of font objects, each containing font_family, font_display, font_id, and variants array.
data[].font_familystringThe CSS font-family name (e.g., "Inter", "Custom Font") used in typography settings.
data[].font_displaystringThe CSS font-display value (swap, auto, block, fallback, optional).
data[].variantsarrayArray of variant objects with weight, style, and files (keyed by format: woff2, woff, ttf, otf).

Related Tools

Technical Details

Tool ID
bricks_get_fonts
API Endpoint
/design-system/fonts
HTTP Method
GET
Namespace
design-system
Source File
design-system/fonts.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release.
20250101