question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Monospaced fonts are not selected with "font-family: monospace"

See original GitHub issue

It’s great that in 1.0.0 text is properly kept in PDF (#3), however I discovered an issue with monospaced fonts rendering (a variable-width font is used) . It is especially problematic with source code. The following presentation fragment in remark.js (0.12) has been rendered with old decktape and 1.0.0 (attached).

# Power Assertions - basic case

 - reused Java `assert` keyword

```groovy
assert (2 + 3) * 4 != (2 * 4) + (3 * 4)
```

--
 - self explaining reason of failure

```groovy
Assertion failed:

assert (2 + 3) * 4 != (2 * 4) + (3 * 4)
          |    |   |     |    |    |
          5    20  false 8    20   12
```

In a case there would be a problem with reproduce that issue I can provide complete example.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
astefanutticommented, Sep 30, 2016

With the minimal test case test.html hereafter:

<html>
<head>
<title>title</title>
</head>
<style>
    body {
        font-family: monospace
    }
</style>
<body>
    <div>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>

</body>
</html>

Running phantomjs-osx-cocoa-x86-64 examples/rasterize.js test.html test.pdf with the pre 1.0.0 Mac OS X binary produces test.pdf.

Running phantomjs-osx-cocoa-x86-64 examples/rasterize.js test.html test-1.0.0.pdf with the 1.0.0 Mac OS X binary produces test-1.0.0.pdf.

So it’s a regression introduced between astefanutti/phantomjs@cc06f44 and astefanutti/phantomjs@9462bc2. There has been the upgrade to Qt 5.6 in between. Hopefully that’ll help narrowing down the analysis.

0reactions
astefanutticommented, Aug 25, 2017

Should be fixed in version 2.0.1 that uses headless Chrome. Let me know if you still face this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Monospace font not being chosen correctly when font-family ...
Monospace font not being chosen correctly when font-family starts with missing fonts. The inspector for these websites underlines "monospace" ...
Read more >
Monospaced fonts are not monospaced
While this is not an answer, I did not want to add it as a comment. The issue is not specific to Linux,...
Read more >
Monospace font characters are not fixed width - Stack Overflow
I'm trying to align some characters to draw a box in html. I've picked a monospace font so that characters are aligned, and...
Read more >
Monospaced font - Wikipedia
A monospaced font, also called a fixed-pitch, fixed-width, or non-proportional font, is a font whose letters and characters each occupy the same amount...
Read more >
Inconsolata - Google Fonts
It is a monospace font, designed for printed code listings and the like. ... demonstrated clearly to me that monospaced fonts do not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found