Hello there,
I am facing a problem trying to use custom fonts while exporting Confluence pages to PDF.
In my documents, I use Facit font family. This font family, as many other, has multiple levels of weight (Regular, Semibold, Bold, Extrabold, Light and Extralight), as well as these levels in italic style. I attached them to an auxiliary file, and referenced them in PDF export stylesheet when using @font-face at rule.
But for some reason, when exporting to PDF, only 4 levels seem to be working:
- Regular
- Regular Italic
- Bold
- Bold Italic
I tried to change the font-weight property of the document body to all possible CSS values and nothing seems to change.
I am asking this question to know if Confluence does not accept other levels of weight than those I've mentioned, or if there is some mistake in my stylesheet CSS code.
Kind regards,
Jesús
Hi Jesús,
Have you uploaded the custom font to Confluence as described in: Create a PDF in Another Language? Please note:
To make use of an installed font in your PDF Export style sheet (CSS) refer to it by the font-family ConfluenceInstalledFont.
I look forward to hearing more about how you installed the font and applied it to your PDF stylesheet.
Thanks,
Ann
Hi Ann,
Thanks for your quick reply!
I have not installed the fonts with the method described in the link you provided. Instead, I've done the following steps:
1. Go to Space Settings > Look and Feel > PDF Stylesheet
2. Edit PDF Export Stylesheet
3. Paste this CSS code in it, one time per each font file that I have in the instance:
@font-face {
font-family: Facit;
src: url(https://my-instance.atlassian.net/wiki/download/attachments/resource-page-ID/font-file.otf);
-fs-pdf-font-embed: embed;
}
Where font-file.otf is substituted by the following font files:
Facit-Bold.otf
Facit-BoldItalic.otf
Facit-Extrabold.otf
Facit-ExtraboldItalic.otf
Facit-Extralight.otf
Facit-ExtralightItalic.otf
Facit-Light.otf
Facit-LightItalic.otf
Facit-Regular.otf
Facit-RegularItalic.otf
Facit-Semibold.otf
Facit-SemiboldItalic.otf
4. Specify by CSS code that the body will use this font-family:
body{
font-family: Facit;
}
I've also tried to specify the font weight when defining the font-face rules, like this:
@font-face {
font-family: Facit;
src: url(https://my-instance.atlassian.net/wiki/download/attachments/resource-page-ID/Facit-Extrabold.otf);
font-weight: bolder;
-fs-pdf-font-embed: embed;
}
But it doesn't seem to have any impact while exporting to PDF. I keep getting only the four fonts that I've mentioned in the previous post, but nothing with all the others.
Regards,
Jesús
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.