Using a custom icon font with asciidoctor-pdf

Viewed 22

I have managed to use a custom icon font replacing FontAwesome in AsciiDoc by doing the following.

I have placed my font files in my AsciiDoc root directory:

  • icons.css
  • fonts/icons.eot
  • fonts/icons.svg
  • fonts/icons.ttf
  • fonts/icons.woff

I have set the following properties in the AsciiDoc document:

:icons: font
:iconfont-remote!:
:iconfont-name: icons

The icon is rendered correctly in the HTML output and in the VS code plugin preview. When creating a pdf from the asciidoc, though, the icon doesn't appear. I use this command to generate the pdf:

bundle exec asciidoctor-pdf book.adoc -o out/book.pdf

And I receive this error (the icon is not renderered):

asciidoctor: WARNING: my-icon is not a valid icon name in the fa icon set

Does asciidoctor-pdf need to be pointed to the custom icon font in some way? I have tried looking for answers in the docs but couldn't find any (as a matter of fact, also making this work with HTML took some experimentation).

0 Answers
Related