XF 2.3 How to add a font?

Levina

Active member
Hi everybody.

I would like to use a font of my own in some headers. How do I add it to the ACP?
I'm on cloud hosting if that is relevant.

Thanks.
 
You can edit the PAGE_CONTAINER template to add them to the <head> section if that's what you mean. You can then adjust the font stack in the typography style properties, or via extra.less if you need something more granular.
 
You can edit the PAGE_CONTAINER template to add them to the <head> section if that's what you mean. You can then adjust the font stack in the typography style properties, or via extra.less if you need something more granular.
Thanks, Jeremy. But how do I actually upload the font? I mean, I assume the system doesn't know every font out there?
 
You would need the font in a web-compatible format like WOFF2. Google has a library of fonts which are free to use with instructions for how to use them, for example. You would edit the PAGE_CONTAINER template to include the embed code, and then edit the typography style properties to include the font family.
 
You can also add it on the extra.less template.

Code:
@font-face {
  font-family: ABC Font;
  src: url(http://example.com/path_to_font/abcfont.woff);
}

You will need the url of the font .woff file if it’s remote, or else upload it to a folder if you can do that on xf cloud.
 
Last edited:
You can also add it on the extra.less template.

Code:
@font-face {
  font-family: ABC Font;
  src: url(http://example.com/path_to_font/abcfont.woff);
}

You will need the url of the font .woff file if it’s remote, or else upload it to a folder if you can do that on xf cloud.
Well, we have a File manager in the ACP so uploading a file shouldn't be a problem.
 
You would need the font in a web-compatible format like WOFF2. Google has a library of fonts which are free to use with instructions for how to use them, for example. You would edit the PAGE_CONTAINER template to include the embed code, and then edit the typography style properties to include the font family.
Getting the font in a WOFF2 format is more problematic. I have it as a True Type Font but that's not going to do me much good here and it's not in Google's Library of fonts. I could contact the developer of the font, see if they can help.

Thanks a lot, Jeremy!

EDIT: I just bought it in every possible format from the developer. Yay!
 
Last edited:
That may be true, but I have had no problem - if it works, it works.
Sure. But I had to get the pro package anyway because the .ttf file I had was a free download and too basic. The pro package includes a .ttf, .otf and .woff file, all with extended language options. I will use the .woff file.
 
Back
Top Bottom