Closed wxguy closed 1 year ago
Given the location of this error, this looks like a problem in Prawn itself (and perhaps due to bad data provided by ttfunk). Here's the code at the line in question:
def scale_factor
@scale_factor ||= 1000.0 / @ttf.header.units_per_em
end
This is not something we can deal with in Asciidoctor PDF. You'll need to file the issue in Prawn (or more likely, ttfunk). I recommend trying to reduce this to a reproducible scenario so that the authors are able to debug it.
Another approach would be to open the fonts in FontForge and resave them. It's possible one of the fonts is malformed somehow. Sometimes reexorting it will fix it.
Thank you for your reply. Solved the issue by replacing the font
section with following which was copied from default theme:
font:
catalog:
# Noto Serif supports Latin, Latin-1 Supplement, Latin Extended-A, Greek, Cyrillic, Vietnamese & an assortment of symbols
Noto Serif:
normal: GEM_FONTS_DIR/notoserif-regular-subset.ttf
bold: GEM_FONTS_DIR/notoserif-bold-subset.ttf
italic: GEM_FONTS_DIR/notoserif-italic-subset.ttf
bold_italic: GEM_FONTS_DIR/notoserif-bold_italic-subset.ttf
# M+ 1mn supports ASCII and the circled numbers used for conums
M+ 1mn:
normal: GEM_FONTS_DIR/mplus1mn-regular-subset.ttf
bold: GEM_FONTS_DIR/mplus1mn-bold-subset.ttf
italic: GEM_FONTS_DIR/mplus1mn-italic-subset.ttf
bold_italic: GEM_FONTS_DIR/mplus1mn-bold_italic-subset.ttf
It works now without giving me error.
Glad to hear it!
Btw, if you extend the default theme, you don't have to declare the built-in fonts as it will use them by default. See https://docs.asciidoctor.org/pdf-converter/latest/theme/create-theme/#extend-default If you need to add your own fonts in addition to the default fonts, then you would use the merge: true
key. See https://docs.asciidoctor.org/pdf-converter/latest/theme/font/#extend-catalog
Here is the version of
asciidoctor-pdf
I am using:I have been using the
asciidoctor-pdf
for quite some time. I don't remember the earlier version ofasciidoctor-pdf
I was using. But recently upgraded my system hardware and installed the application fresh. Following is the command I use for generating PDF file using a custom theme file:-However, it produces the following error.
Here is the content of
data/fonts
directory:and here is the custom theme font section I use:
I looked at the similar error reported at https://github.com/asciidoctor/asciidoctor-pdf/issues/2349 but it appears to be not related to it as I have not included any SVG image in my draft book. I used the same command earlier (around 4-5 months back) as well but that time, it produced PDF without error.