Fonts in WebHelp

Having trouble installing Oxygen XML WebHelp? Got a bug to report? Post it all here.
ahiggins
Posts: 12
Joined: Mon Jun 06, 2022 10:10 pm

Fonts in WebHelp

Post by ahiggins »

Hi,

I downloaded a true type font (.ttf) file and am trying to use it in WebHelp. I created a 'fonts' folder in my custom WebHelp template, and pointed to the font file using the following CSS rule:

Code: Select all

@font-face{
    font-family: 'font';
    src: url("../fonts/font.ttf") format('truetype');
}
In my opt file, between the <resources> tag, I also added

Code: Select all

<fileset>
	<include name="fonts/*"/>
</fileset>
to copy the font file to the output folder.

But, after defining the font-family for an html element, the font doesn't work. Am I missing something?

Thanks,
Amy
alin
Site Admin
Posts: 268
Joined: Thu Dec 24, 2009 11:21 am

Re: Fonts in WebHelp

Post by alin »

Hello,

The font file is not copied in the output folder most probably because you have specified an incorrect fileset include pattern in the resources section of your OPT file. To determine if the pattern is correct or not you must specify the layout (structure) of your publishing template's directory.

Moreover, you can have a look at this working publishing template example that covers a similar use case: https://github.com/oxygenxml/oxygen-pub ... ustom-font

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
ahiggins
Posts: 12
Joined: Mon Jun 06, 2022 10:10 pm

Re: Fonts in WebHelp

Post by ahiggins »

Thanks Alin, this example is very helpful
Post Reply