-
Notifications
You must be signed in to change notification settings - Fork 176
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
Monospaced fonts are not selected with "font-family: monospace" #67
Comments
GitHub doesn't like my PDF files. Here's the links: |
What exact OS do you use? I've exported default remark.js presentation using the Docker image (Debian 8) and it seems monospaced text renders correctly - test.pdf - though that's a Web font being used. I've noticed that for local font family, results may vary depending on the distribution. It looks like the font used in |
I've been using Docker image of 1.0.0. |
Btw, there is something strange with font inside source code in test.pdf. E.g. on a page 15 the top of the question marks are not fully visible. |
Maybe in my case there is a problem with used font. I will prepare a small presentation reproducing the problem. |
Slide 15 of
Great, I'll wait for that and investigate. I've already noticed that local monospaced font may render differently from a distribution to another. So lets find out what's going on... |
I dig a little bit and it turned out that the mentioned effect occurs in the situation where there is no font explicitly defined to handle text formatted as code (i.e. just "font-family: monospace" for given CSS class is not enough). When the font is defined explicitly the rendering works fine. In general it is a good idea to have a concrete monospaced font defined (see your issues with the official remark presentation on MacOS), however, I wonder why QT doesn't fallback to default monospaced font installed in the system? Maybe there is non in the Debian image (such as Deja Vu)? Sample code to reproduce the issue (tested with the Docker image). Uncomment the style definition to "fix" the issue:
|
"Deja Vu Sans Mono" seems to be already installed on the Docker image. By installing
It seems that "DejaVu Sans Mono" correctly resolves for A quick search into PhantomJS issue tracker leads to ariya/phantomjs#11764 and ariya/phantomjs#11468. I haven't yet dig into these though that may be a start. |
FWIW, I can reproduce it with the default reveal.js presentation on Mac OS X. |
With the minimal test case
Running Running 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. |
Following-up on #79, I've just tried with an updated Docker image, having the
However, with
So I suspect it happens whenever a generic font family is used (monospace, serif, sans-serif, ...), where it fails to pick the correct font, as resolved by Fontconfig, irrespective of the already present fonts in the image:
|
Is there a quick workaround? |
@wrzasa if you can easily change your CSS style, one alternative is to specify the font name directly instead of the font family. |
Thank you very much! Very helpful! |
For anyone looking for quick workaround, this worked for me:
|
Should be fixed in version |
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).
In a case there would be a problem with reproduce that issue I can provide complete example.
The text was updated successfully, but these errors were encountered: