font in header and footer (css pdf)
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 11
- Joined: Thu Jul 06, 2023 5:31 pm
font in header and footer (css pdf)
Hi,
could sb help me with this:
In css file for pdf output I've set:
* {
font-family: "Roboto", sans-serif !important;
}
to have the same fonts in the whole pdf document.
All elements display as Roboto except the footer and header, where I get an Arial font, which I have not defined in my customization css
I've also tried defining font-family for @page @top-right ,@top-left, etc, but that does not help.
thanks
/Wojtek
could sb help me with this:
In css file for pdf output I've set:
* {
font-family: "Roboto", sans-serif !important;
}
to have the same fonts in the whole pdf document.
All elements display as Roboto except the footer and header, where I get an Arial font, which I have not defined in my customization css
I've also tried defining font-family for @page @top-right ,@top-left, etc, but that does not help.
thanks
/Wojtek
Wojtek
-
- Posts: 667
- Joined: Wed Oct 16, 2019 3:47 pm
Re: font in header and footer (css pdf)
Post by julien_lacour »
Hello,
If you want to set a font in the header and footer, you need to use the @page rule as explained in How to Change the Font of the Headers and Footers.
If you are using Oxygen Styles Basket to create a publishing template, the generated CSS will contain a rule similar to this one:
Regards,
Julien
If you want to set a font in the header and footer, you need to use the @page rule as explained in How to Change the Font of the Headers and Footers.
If you are using Oxygen Styles Basket to create a publishing template, the generated CSS will contain a rule similar to this one:
Code: Select all
@page {
font-family: SelectedFont, sans-serif;
}
Julien
-
- Posts: 11
- Joined: Thu Jul 06, 2023 5:31 pm
Re: font in header and footer (css pdf)
Hi,
I did the trial with Oxygen Styles Basket and figured out that maybe my font source is not suitable - I had it defined like this (from local disc):
@font-face {
font-family: roboto;
font-style: normal;
font-weight: 400;
src: url(fonts/roboto/Roboto-Regular.ttf) ;
}
@font-face {
font-family: roboto;
font-style: normal;
font-weight: 700;
src: url(fonts/roboto/Roboto-Bold.ttf) ;
}
@font-face {
font-family: roboto;
font-style: normal;
font-weight: 300;
src: url(fonts/roboto/Roboto-Light.ttf);
}
Apparently, it was not enough so copy-paste of font import from styles:
@import url('https://fonts.googleapis.com/css?family ... splay=swap');
I don't really understand why yet, but it worked!
Thank you
I did the trial with Oxygen Styles Basket and figured out that maybe my font source is not suitable - I had it defined like this (from local disc):
@font-face {
font-family: roboto;
font-style: normal;
font-weight: 400;
src: url(fonts/roboto/Roboto-Regular.ttf) ;
}
@font-face {
font-family: roboto;
font-style: normal;
font-weight: 700;
src: url(fonts/roboto/Roboto-Bold.ttf) ;
}
@font-face {
font-family: roboto;
font-style: normal;
font-weight: 300;
src: url(fonts/roboto/Roboto-Light.ttf);
}
Apparently, it was not enough so copy-paste of font import from styles:
@import url('https://fonts.googleapis.com/css?family ... splay=swap');
I don't really understand why yet, but it worked!
Thank you
Last edited by Ecumaster on Fri Jul 14, 2023 3:05 pm, edited 1 time in total.
Wojtek
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service