Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asciidoctorj-pdf: Notoserif-regular-latin font not found #389

Closed
indigo423 opened this issue Oct 15, 2015 · 4 comments
Closed

asciidoctorj-pdf: Notoserif-regular-latin font not found #389

indigo423 opened this issue Oct 15, 2015 · 4 comments

Comments

@indigo423
Copy link

I've switched from version 1.5.0.alpha.6 to 1.5.0.alpha.9 and got the following error message:

[ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.2.1:process-asciidoc (generate-pdf-doc) on project opennms-community-welcome-guide: Execution generate-pdf-doc of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.2.1:process-asciidoc failed: (ArgumentError) uri:classloader://gems/asciidoctor-pdf-1.5.0.alpha.9/data/fonts/notoserif-regular-latin.ttf not found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.2.1:process-asciidoc (generate-pdf-doc) on project opennms-community-welcome-guide: Execution generate-pdf-doc of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.2.1:process-asciidoc failed: (ArgumentError) uri:classloader://gems/asciidoctor-pdf-1.5.0.alpha.9/data/fonts/notoserif-regular-latin.ttf not found
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate-pdf-doc of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.2.1:process-asciidoc failed: (ArgumentError) uri:classloader://gems/asciidoctor-pdf-1.5.0.alpha.9/data/fonts/notoserif-regular-latin.ttf not found
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 20 more
Caused by: org.jruby.exceptions.RaiseException: (ArgumentError) uri:classloader://gems/asciidoctor-pdf-1.5.0.alpha.9/data/fonts/notoserif-regular-latin.ttf not found
    at RUBY.verify_and_open(uri:classloader:/gems/ttfunk-1.4.0/lib/ttfunk.rb:34)
    at RUBY.open(uri:classloader:/gems/ttfunk-1.4.0/lib/ttfunk.rb:13)
    at RUBY.read_ttf_file(uri:classloader:/gems/prawn-1.3.0/lib/prawn/font/ttf.rb:347)
    at RUBY.initialize(uri:classloader:/gems/prawn-1.3.0/lib/prawn/font/ttf.rb:27)
    at RUBY.load(uri:classloader:/gems/prawn-1.3.0/lib/prawn/font.rb:292)
    at RUBY.find_font(uri:classloader:/gems/prawn-1.3.0/lib/prawn/font.rb:244)
    at RUBY.font(uri:classloader:/gems/prawn-1.3.0/lib/prawn/font.rb:58)
    at RUBY.font(uri:classloader:/gems/asciidoctor-pdf-1.5.0.alpha.9/lib/asciidoctor-pdf/prawn_ext/extensions.rb:180)
    at RUBY.layout_title_page(uri:classloader:/gems/asciidoctor-pdf-1.5.0.alpha.9/lib/asciidoctor-pdf/converter.rb:1492)
    at RUBY.convert_document(uri:classloader:/gems/asciidoctor-pdf-1.5.0.alpha.9/lib/asciidoctor-pdf/converter.rb:144)
    at RUBY.convert(uri:classloader:/gems/asciidoctor-pdf-1.5.0.alpha.9/lib/asciidoctor-pdf/converter.rb:97)
    at RUBY.convert(uri:classloader:/gems/asciidoctor-1.5.2/lib/asciidoctor/document.rb:1028)
    at RUBY.convert(uri:classloader:/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1499)
    at RUBY.convert_file(uri:classloader:/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1562)
    at RUBY.convertFile(<script>:68)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

I've downgraded to 1.5.0.alpha.8 and works fine. So it seems this issue is introduced in the latest alpha release.

The document I tried to upgrade to latest version can be found here: https://github.com/opennms-forge/opennms-community-welcome-guide

@indigo423 indigo423 changed the title Notoserif-regular-latin font not found asciidoctorj-pdf: Notoserif-regular-latin font not found Oct 15, 2015
@robertpanzer
Copy link
Member

Comparing asciidoctor-pdf alpha.8 with alpha.9 I can see that 9 contains the fonts notoserif-*-subset while 8 (and probably the earlier versions) contain the fonts notoserif-*-latin.ttf.
In the referenced repository a default-theme.yml is used that explicitly refers to the latin font:

font:
  catalog:
    NotoSerif:
      normal: notoserif-regular-latin.ttf
      bold: notoserif-bold-latin.ttf
      italic: notoserif-italic-latin.ttf
      bold_italic: notoserif-bolditalic-latin.ttf

Changing latin to subset makes the document render successfully again.

I am not so much into PDF rendering yet that I can judge this, so maybe it's best to ask the question via an issue in the https://github.com/asciidoctor/asciidoctor-pdf repo.
(In particular as rendering fails as well with asciidoctor-pdf -a pdf-style=default-theme.yml src/asciidoc/index.adoc)

@mojavelinux
Copy link
Member

Changing latin to subset makes the document render successfully again.

You have it exactly right. We changed the names of the fonts, so if you have a custom theme, you need to update the names of the fonts there too. If you plan to use the built-in fonts in your theme, just make sure they have the same name as what you find here:

https://github.com/asciidoctor/asciidoctor-pdf/blob/master/data/themes/default-theme.yml

@robertpanzer
Copy link
Member

@indigo423 Are you ok to close this issue?

@indigo423
Copy link
Author

Sorry for the delay. I was able to fix this problem by updating to the latest default theme. All my changes regarding to fix this issue are in pull request: OpenNMS/opennms#520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants