Login  Register

Re: asciidoctor-pdf with custom style: problem with fonts

Posted by mojavelinux on Jul 17, 2019; 6:31pm
URL: https://discuss.asciidoctor.org/asciidoctor-pdf-with-custom-style-problem-with-fonts-tp6992p6997.html

Siegfried,

Please don't install the gem into the system. That's just going to lead to complications. Use something like RVM or Bundler to manage the gem inside your home directory or inside your project. And you definitely shouldn't be adding a custom theme to the gem's installation directory. That's not how the gem was designed to work.

This command is more correct:

/usr/local/bin/asciidoctor-pdf -d book -b pdf  -a title -a pdf-themesdir=resources/themes -a pdf-fontsdir=resources/fonts -a pdf-theme=hit  -o /u1/dcpa/etroot_entw/tmp/tmp.25190.pdf Noah.asc

Except a few things:

* Verify you are really running 1.5.0.beta.1 by using asciidoctor-pdf -v
* Prefix the pdf-themesdir value with ./
* You don't need to specify the pdf-fontsdir or copy the fonts if you are using the bundled fonts (they will be discovered automatically)
* Use .adoc as the AsciiDoc file extension (just a side note)

If you do those things, I'm confident it will work. But I still recommend using RVM or Bundler to manage the gem because installing into the system (anywhere outside of home) is going to be problematic (unless you can install from a Linux package, but you can't since it's too out of date).

Best,

-Dan

On Wed, Jul 17, 2019 at 7:17 AM Siegfried Kurz [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello Dan,
so I've upgraded asciidoctor-pdf to 1.5.0.beta.1, which is installed into /usr/local/bin/asciidoctor-pdf

/usr/local/bin/asciidoctor-pdf -V
Asciidoctor PDF 1.5.0.beta.1 using Asciidoctor 2.0.10 [https://asciidoctor.org]
Runtime Environment (ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]) (lc:ISO-8859-15 fs:ISO-8859-15 in:ISO-8859-15 ex:ISO-8859-15)

gem contents asciidoctor-pdf --show-install-dir
now results in:
/usr/local/lib64/ruby/gems/2.6.0/gems/asciidoctor-pdf-1.5.0.beta.1

cat /usr/local/lib64/ruby/gems/2.6.0/gems/asciidoctor-pdf-1.5.0.beta.1/data/themes/hit-theme.yml
extends: default
heading:
   font-color: #0066CC

ls -la  /usr/local/lib64/ruby/gems/2.6.0/gems/asciidoctor-pdf-1.5.0.beta.1/data/fonts

-rwxrwxrwx 1 root root     375 Jul 17 14:07 LICENSE-mplus-testflight-58*
-rwxrwxrwx 1 root root   11357 Jul 17 14:07 LICENSE-noto-2015-06-05*
-rwxrwxrwx 1 root root   15868 Jul 17 14:07 mplus1mn-bold-ascii.ttf*
-rwxrwxrwx 1 root root   15908 Jul 17 14:07 mplus1mn-bold_italic-ascii.ttf*
-rwxrwxrwx 1 root root   15928 Jul 17 14:07 mplus1mn-italic-ascii.ttf*
-rwxrwxrwx 1 root root   20024 Jul 17 14:07 mplus1mn-regular-ascii-conums.ttf*
-rwxrwxrwx 1 root root 1353324 Jul 17 14:07 mplus1p-regular-fallback.ttf*
-rwxrwxrwx 1 root root  234300 Jul 17 14:07 notoserif-bold_italic-subset.ttf*
-rwxrwxrwx 1 root root  221460 Jul 17 14:07 notoserif-bold-subset.ttf*
-rwxrwxrwx 1 root root  207852 Jul 17 14:07 notoserif-italic-subset.ttf*
-rwxrwxrwx 1 root root  220668 Jul 17 14:07 notoserif-regular-subset.ttf*

my commandline is:
/usr/local/bin/asciidoctor-pdf -d book -b pdf  -a title -a pdf-fontsdir=/usr/local/lib64/ruby/gems/2.6.0/gems/asciidoctor-pdf-1.5.0.beta.1/data/fonts -a pdf-style=/usr/local/lib64/ruby/gems/2.6.0/gems/asciidoctor-pdf-1.5.0.beta.1/data/themes/hit-theme.yml  -o /u1/dcpa/etroot_entw/tmp/tmp.23867.pdf Noah.asc

with this commandline, no errors, but the theme hit-theme.yml is been ignored

I've tried also the commandline from the docs:
/usr/local/bin/asciidoctor-pdf -d book -b pdf  -a title -a pdf-themesdir=resources/themes -a pdf-fontsdir=resources/fonts -a pdf-theme=hit  -o /u1/dcpa/etroot_entw/tmp/tmp.25190.pdf Noah.asc

here also, no errors, but the theme hit is been ignored

for this, I've copied the fonts and the theme into the file-structure from the docs-example:

cd <sourcedir>
find ./resources
./resources
./resources/fonts
./resources/fonts/mplus1p-regular-fallback.ttf
./resources/fonts/notoserif-bold_italic-subset.ttf
./resources/fonts/mplus1mn-bold_italic-ascii.ttf
./resources/fonts/mplus1mn-italic-ascii.ttf
./resources/fonts/notoserif-italic-subset.ttf
./resources/fonts/LICENSE-mplus-testflight-58
./resources/fonts/notoserif-regular-subset.ttf
./resources/fonts/LICENSE-noto-2015-06-05
./resources/fonts/mplus1mn-bold-ascii.ttf
./resources/fonts/mplus1mn-regular-ascii-conums.ttf
./resources/fonts/notoserif-bold-subset.ttf
./resources/themes
./resources/themes/hit-theme.yml

cat resources/themes/hit-theme.yml
extends: default
heading:
   font-color: #0066CC


best regards from germany
Siegfried






If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/asciidoctor-pdf-with-custom-style-problem-with-fonts-tp6992p6996.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux