Asciidoctor-pdf: Inline images are displayed more than once when alt text uses fallback font

Created on 7 Jan 2021  ·  3Comments  ·  Source: asciidoctor/asciidoctor-pdf

Hi I found a problem using the image macro with 'default-with-fallback-font' theme and some alt text using CJK symbols.

Images are displayed more than once.

An example

Using the following file:

= Example

image:example.png[チのデータレプリケーションです。]

Image:

diagram_cloud_manager_overview

Command

asciidoctor-pdf -a pdf-theme=default-with-fallback-font example.adoc

Result

example.pdf

More info

# asciidoctor-pdf -v
Asciidoctor PDF 1.5.3 using Asciidoctor 2.0.12 [https://asciidoctor.org]
Runtime Environment (ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic

Am I doing something wrong?

It seems to be related with this line

bug v1.5.4 v2.0.0

All 3 comments

You're correct that the consultation of the fallback font for alt text is interfering with the rendering of inline images. It's probably calling the image arranger multiple times.

In the meantime, you can fix it by using a block image. See https://docs.asciidoctor.org/asciidoc/latest/macros/images/#block-image-macro

Indeed, when the image fragment is divided up to use the fallback font, this causes the image to be rendered multiple times. I have a fix for it.

Great, thank you!!

Was this page helpful?
0 / 5 - 0 ratings