-
Notifications
You must be signed in to change notification settings - Fork 499
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
Nested unordered lists crash the renderer when a non-default font is in use #619
Comments
you have to use 'good' fallback font to avoid that problem (not the one documentation states -- it is quite hard to download correctly) I for myself copied M+ fallback font which default theme uses, added to the theme and this error had gone away. |
My theme setup regarding fonts:
|
Well, I am really sorry ;) I can reproduce your error with the level 3 unordered list items. And fallback font doesn't help it. |
I guess it is better to use gogle Noto font then ... |
I have the probably same issue when I use M+ 1mn fonts with full glyphs (get from here), instead of built-in ones. I have just set base_font_family as M+ 1mn in default-theme.yml, and replaced those ttf files. Used command:
test.adoc:
Traces: traces.txt |
Okay, I understand what the bug is now. The problem is, we are calculating the width of the glyph from the current font, even if the glyph is missing. Then, Prawn uses the fallback font to render the missing glyph, which almost always has a different width. We need to calculate the width based on the glyph Prawn is actually going to use. In theory, it's simple enough to solve. |
I'm pursuing a fix in #651. |
Resolved by 21a3bcf. |
Is it possible we're missing calculating the height as well? (#798) |
That's a possibility. But once #798 is resolved, you'll have a lot more control over the marker and will have the power to customize it if you run into something like this again. |
@mojavelinux I am experiencing a crash when there is any nested UL list, but I am not getting any error when building the PDF, which is leaving me wondering if there is any issue with the glyph actually fitting, or the issue is something else. |
@hanna-del-rae Have you tried the unreleased version? You can find instructions for how to test here: https://github.com/asciidoctor/asciidoctor-pdf#development |
If I create an asciidoc file that has an unordered list in it with nested items, it yields the following error when trying to render it using my custom stylesheet:
This appears to happen when the font is missing the bullet glyphs that asciidoctor uses for specific nested levels.
The simplest examples of failing files I can produce are as follows:
Modify default-theme.yml to add Roboto:
(note: I chose Roboto arbitrarily; the one I'm actually trying to use isn't freely licensed. I've reproduced this with a number of different fonts, however. The difference is in how many of the glyphs the font has. Helvetica Neue, for example, works up until the 2nd nesting level, but fails beyond that.)
my-theme.yml
simple.adoc
If I remove the fallback font from the stylesheet, the document will render, but without bullets for the 2nd and 3rd levels of nesting.
The text was updated successfully, but these errors were encountered: