Styling SVG fonts for a PDF using CSS

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
TopSolid
Posts: 6
Joined: Tue Jun 27, 2023 11:00 am

Styling SVG fonts for a PDF using CSS

Post by TopSolid »

How to define fonts for SVG text tag using chemistry CSS?
andrei_pomacu
Posts: 39
Joined: Mon Jul 25, 2022 11:18 am

Re: Styling SVG fonts for a PDF using CSS

Post by andrei_pomacu »

Hi,
In Chemsitry exists a parameter called use.css.for.embedded.svg which on default is set on yes.
In your CSS you just need to match that tag element and use font-family rule to change the font.

Code: Select all

text {
  font-family: Arial, sans-serif;
}
If the font-family rule does not apply directly of the elements that you have targeted using CSS you can visit this topic in order to detect which rule need to override in order to achieve your font changing.
Regards,
Andrei
TopSolid
Posts: 6
Joined: Tue Jun 27, 2023 11:00 am

Re: Styling SVG fonts for a PDF using CSS

Post by TopSolid »

Thanks Andrei, it is now working!
Best
Paco
Posts: 1
Joined: Wed Sep 20, 2023 8:33 am
Contact:

Re: Styling SVG fonts for a PDF using CSS

Post by Paco »

Hello,

Thanks for the useful information. Changing the font with the font-family rule seems to be a practical solution.
Post Reply