Page 1 of 1

Fonts in WebHelp

Posted: Wed Dec 14, 2022 4:21 pm
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

Re: Fonts in WebHelp

Posted: Wed Dec 14, 2022 6:35 pm
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

Re: Fonts in WebHelp

Posted: Thu Dec 15, 2022 7:54 pm
by ahiggins
Thanks Alin, this example is very helpful