Asciidoctor-PDF Theming Guide question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Asciidoctor-PDF Theming Guide question

jlo2k
Theming Guide says:
If you want to specify the location of custom fonts using the pdf-fontsdir attribute, yet still be able to reference the bundled fonts, you need to refer to the bundled fonts using the GEM_FONTS_DIR token. To do so, you can either a) prefix the path of the bundled font in the theme file with the segment GEM_FONTS_DIR (e.g., GEM_FONTS_DIR/mplus1p-regular-fallback.ttf, or b) use relative paths in the theme file and include GEM_FONT_DIR in the value of the pdf-fontsdir attribute separated by the location of your custom fonts using a comma (e.g., path/to/your/fonts,GEM_FONTS_DIR) or a semi-colon (e.g., path/to/your/fonts;GEM_FONTS_DIR).
Although extending from default, the fonts of default were not found. Since default includes the token already i was confused why i had to add the token also to fontsdir path ...;GEM_FONTS_DIR.
Do i misinterpet the guide?
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor-PDF Theming Guide question

mojavelinux
Administrator
There's a difference in behavior between Asciidoctor PDF 1.5.x and the upcoming Asciidoctor PDF 2.0.0 release on the main branch. The default theme in Asciidoctor PDF 1.5.x does not include the GEM_FONTS_DIR prefix as this would constitute a breaking change. Therefore, if you need to reuse them in your extended theme, they have to be redeclared to include this prefix (or you have to copy the font files to the location of pdf-fontsdir).

I can update the theming guide to point this out.

Best Regards,

-Dan

On Thu, Mar 4, 2021 at 4:41 AM jlo2k [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Theming Guide says:
If you want to specify the location of custom fonts using the pdf-fontsdir attribute, yet still be able to reference the bundled fonts, you need to refer to the bundled fonts using the GEM_FONTS_DIR token. To do so, you can either a) prefix the path of the bundled font in the theme file with the segment GEM_FONTS_DIR (e.g., GEM_FONTS_DIR/mplus1p-regular-fallback.ttf, or b) use relative paths in the theme file and include GEM_FONT_DIR in the value of the pdf-fontsdir attribute separated by the location of your custom fonts using a comma (e.g., path/to/your/fonts,GEM_FONTS_DIR) or a semi-colon (e.g., path/to/your/fonts;GEM_FONTS_DIR).
Although extending from default, the fonts of default were not found. Since default includes the token already i was confused why i had to add the token also to fontsdir path ...;GEM_FONTS_DIR.
Do i misinterpet the guide?


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Asciidoctor-PDF-Theming-Guide-question-tp8556.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux