Не является известным шрифтом / в `initialize': не является известным шрифтом. (Креветки:: Ошибки::UnknownFont)
Я использую asciidoctor-pdf
преобразовать документ adoc в pdf, но всегда есть ошибка, которая "не является известным шрифтом", при добавлении --trace после командной строки ошибка
`initialize': is not a known font. (Prawn::Errors::UnknownFont)
/usr/local/lib/ruby/gems/2.4.0/gems/prawn-2.2.2/lib/prawn/font/afm.rb:53:in `initialize': is not a known font. (Prawn::Errors::UnknownFont)
from /usr/local/lib/ruby/gems/2.4.0/gems/prawn-2.2.2/lib/prawn/font.rb:301:in `new'
from /usr/local/lib/ruby/gems/2.4.0/gems/prawn-2.2.2/lib/prawn/font.rb:301:in `load'
from /usr/local/lib/ruby/gems/2.4.0/gems/prawn-2.2.2/lib/prawn/font.rb:253:in `find_font'
from /usr/local/lib/ruby/gems/2.4.0/gems/prawn-2.2.2/lib/prawn/font.rb:57:in `font'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/prawn_ext/extensions.rb:196:in `font'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:2930:in `theme_font'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:544:in `convert_admonition'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:118:in `convert'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:70:in `convert'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `block in content'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `map'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `content'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/block.rb:110:in `content'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:134:in `convert_content_for_block'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:479:in `convert_preamble'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:118:in `convert'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:70:in `convert'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `block in content'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `map'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `content'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/document.rb:1120:in `content'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:134:in `convert_content_for_block'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:207:in `convert_document'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:118:in `convert'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/document.rb:1060:in `convert'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor.rb:1502:in `convert'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor.rb:1575:in `block in convert_file'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor.rb:1575:in `open'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor.rb:1575:in `convert_file'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/cli/invoker.rb:108:in `block in invoke!'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/cli/invoker.rb:102:in `each'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/cli/invoker.rb:102:in `invoke!'
from /usr/local/lib/ruby/gems/2.4.0/gems/asciidoctor-pdf-1.5.0.alpha.16/bin/asciidoctor-pdf:31:in `<top (required)>'
from /usr/local/bin/asciidoctor-pdf:23:in `load'
from /usr/local/bin/asciidoctor-pdf:23:in `<main>'
базовый theme.yml
Выполненная команда:
asciidoctor-pdf -a pdf-style=basic-theme.yml -a pdf-fontsdir=/Users/xqd/Desktop/my-awesome-presentation/fonts basic.adoc
1 ответ
Была такая же проблема, и я решил ее, также добавив bold
в каталог шрифтов. Я предполагаю, что ошибка в заголовках разделов, где обычно требуется жирный шрифт. Для хороших мер добавить italic
а также bold_italic
также.
Попробуйте basic-theme.yml
выглядит так:
base:
font_family: KaiGenGothicCN
font:
catalog:
KaiGenGothicCN:
normal: KaiGenGothicCN-Normal.ttf
bold: KaiGenGothicCN-Bold.ttf
italic: KaiGenGothicCN-Italic.ttf
bold_italic: KaiGenGothicCN-Bold-Italic.ttf
Если вам все еще нужны резервные шрифты из-за некоторых ошибок, добавьте следующий раздел:
DroidSansFallback:
normal: droid-sans-fallback.ttf
italic: droid-sans-fallback.ttf
bold: droid-sans-fallback.ttf
bold_italic: droid-sans-fallback.ttf
fallbacks:
- DroidSansFallback
Для получения дополнительной информации обратитесь к: