Troubleshoot missing glyphs (pdf) from TOC generation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Troubleshoot missing glyphs (pdf) from TOC generation

arillbert
Hi,

I get warnings from asciidoctor-pdf as soon as I include a table-of-contents and use my custom theme. As soon as I enable a toc (via :toc: left in the header), I get the following warning:


asciidoctor: WARNING: Could not locate the character `​' in the following fonts: MyFont, MPlus


I am using a custom theme with custom fonts.

 - If I use the default theme/font, no warning is issued.
 - If I use my custom theme/fonts and skip the toc, no warning is issued

Supposedly, asciidoctor-pdf needs a glyph when generating the toc that is missing in the fonts I use for my custom theme.

Any pointers on how I go about troubleshooting this?

/Anders

ps In my theme, I use the M+ 1p font as the fallback font (mplus-1p-regular.ttf) ds



Reply | Threaded
Open this post in threaded view
|

Re: Troubleshoot missing glyphs (pdf) from TOC generation

mojavelinux
Administrator
Have you consulted this section of the docs? https://github.com/asciidoctor/asciidoctor-pdf/blob/v1.5.x/docs/theming-guide.adoc#modifying-the-font It identifies every special character in the font that Asciidoctor PDF depends on.

If it's too much trouble to modify the font, you can add a fallback font that catches anything the primary font doesn't have. See https://github.com/asciidoctor/asciidoctor-pdf/blob/v1.5.x/data/themes/default-with-fallback-font-theme.yml

Best Regards,

-Dan

On Fri, Apr 9, 2021 at 2:17 AM arillbert [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

I get warnings from asciidoctor-pdf as soon as I include a table-of-contents and use my custom theme. As soon as I enable a toc (via :toc: left in the header), I get the following warning:


asciidoctor: WARNING: Could not locate the character `​' in the following fonts: MyFont, MPlus


I am using a custom theme with custom fonts.

 - If I use the default theme/font, no warning is issued.
 - If I use my custom theme/fonts and skip the toc, no warning is issued

Supposedly, asciidoctor-pdf needs a glyph when generating the toc that is missing in the fonts I use for my custom theme.

Any pointers on how I go about troubleshooting this?

/Anders

ps In my theme, I use the M+ 1p font as the fallback font (mplus-1p-regular.ttf) ds






If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Troubleshoot-missing-glyphs-pdf-from-TOC-generation-tp8585.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Troubleshoot missing glyphs (pdf) from TOC generation

Alexander Schwartz
In reply to this post by arillbert
I addition to Dan: Copied the error message to an editor that shows non-printable characters (for example the IntelliJ editor does this).

This shows that the there is a `ZWSP' (zero-width-space).

While this is probably not something you typed in your content, this seems to be something added when creating the automatic TOC.

I raised this in https://github.com/asciidoctor/asciidoctor-pdf/issues/1909 to maybe improve the error message.
Alexander Schwartz (alexander.schwartz@gmx.net)
https://www.ahus1.de
Reply | Threaded
Open this post in threaded view
|

Re: Troubleshoot missing glyphs (pdf) from TOC generation

arillbert
Thank you both for your answers.

I think Alexander's suggestion in the github issue he opened would be a good addition. It would help narrow down the cause of the problem.

Cheers
/Anders
Reply | Threaded
Open this post in threaded view
|

Re: Troubleshoot missing glyphs (pdf) from TOC generation

1marc1
I have something similar happening. Let's say I have this file:

== Test

[[inline-anchor,test paragraph]]Test paragraph.

For more info see <<inline-anchor>>.

When converting to PDF using the default theme, then no warning is displayed. When I use my custom theme no warning is displayed if I don't specify the -v option on the CLI.

When I use my custom theme and do specify the -v option, I see the following warning: asciidoctor: WARNING: Could not locate the character `' in the following fonts: OpenSans, M+ 1mn, M+ 1p Regular Fallback

In all cases clicking the link in the last sentence works as expected. When converted using my custom theme I notice that the text Test paragraph is slightly indented to the right.

It makes me think there is something else in my custom theme causing this. Does anyone have any ideas on what this could be? My theme has the following fallback fonts specified:
fallbacks: [ M+ 1mn, M+ 1p Regular Fallback ]

Next observation. If I change my file to this:

== Test

[[inline-anchor,test paragraph]]
Test paragraph.

For more info see <<inline-anchor>>.

and then convert to PDF using my custom theme and the -v option, then no warning is displayed, the text Test paragraph. does not have the slight indent and the link also works.

Any ideas on what could cause this?

Thank you.

Marc.
Reply | Threaded
Open this post in threaded view
|

Re: Troubleshoot missing glyphs (pdf) from TOC generation

mojavelinux
Administrator
I want to point out something.

[[inline-anchor,test paragraph]]
Test paragraph.

This is a block anchor, not an inline anchor. It's a block anchor because it's on a line by itself. So the two examples you've given are, in fact, different use cases.

I don't know what's going on in your case that you are seeing that warning, but hopefully the updated warning message will help you get to the bottom of it.

Best Regards,

-Dan

--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux