Custom Fonts: Self-hosting

If do not use a default or Google font you can host your own and add to your Candu Styleguide.

Lauren Cumming avatar
Written by Lauren Cumming
Updated over a week ago

If your custom font does not appear in Candu's list of default fonts and is not hosted as a Google font you will need to upload your font to a static location on a self-hosted CDN.

You will then need to create a CSS file that references the font which can be as simple as:

@font-face { 
font-family: 'Open Sans';
src: url("https://cdn-staging.candu.ai/example/fonts/OpenSans-Italic-VariableFont_wdth,wght.ttf");
}

This file must be available with appropriate CORS headers for the Candu domain to fetch it.

Once you are hosting your font, you can add this to the custom font section in your Styleguide.

Pate the URL link into the custom font section and it should then be available to select as a custom font for typography elements.

ℹ️ Please note you will need to do this for each Text type.

Did this answer your question?