Font provider documentation

Last updated on
30 April 2025

Nearly all fonts in @font-your-face come from a 3rd-party service via some API. If you provide a web font service and would like to make your fonts available for use in Drupal via @font-your-face, this is what your API should look like:

Format

@font-your-face can work with a variety of API formats, but JSON is preferred.

List of fonts

First, we need a list of all available fonts. For commercial services without previews (see below), all available fonts may be only fonts already purchased. For each font, please provide:

  • Font name (required)
  • Font CSS family-name (required)
  • Font CSS weight (required, i.e. bold, normal)
  • Font CSS style (required, i.e. italic, normal)
  • Unique URL (required, used as UUID as well as link)
  • Foundry name
  • Foundry URL
  • License name
  • License URL
  • Designer name
  • Designer URL
  • Tags (i.e. category names that could be useful when browsing fonts)

This information can be provided at a single URL or multiple. Fewer HTTP requests are preferred, though very long lists (e.g. over 200k) should be broken up somehow (i.e. a page parameter).

Previews

If you're providing fonts as part of a paid service, use of the @font-your-face interface is extremely limited without an ability to preview fonts. These previews can be limited to prevent use on live sites, e.g. only specific characters (AaGg is suggested), specific domains, or pre-rendered images.

How to apply fonts

Different web font services apply fonts in different ways. While not part of your API, we will need to know how a font should be loaded from your service. For example, this might happen by passing a font ID to a URL to generate specific CSS or JS, or by passing a site ID or user ID. For any information not included in the API, we will need instructions to pass on to users, e.g. where on your site do they get their site ID?

Contact

If you have questions about creating your web font API, or just want to let us know you have something we can use, either open (or join) an issue in the project issue queue, or use Scott Reynen's contact form.

Help improve this page

Page status: Not set

You can: