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.

Chrome&Chromium will not display webfonts, @import fonts on Ubuntu 16

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.4.0
  • Platform / OS version: Ubuntu Server 16.04 LTS
  • URLs (if applicable): http://graphemica.com/⧁
  • Node.js version: v8.11.2

What steps will reproduce the problem?

  1. Open new browser & page
  2. Navigate to URL
  3. Take screenshot to file on disk

Please include code that reproduces the issue.

'use strict';

const puppeteer = require('puppeteer');

(async() => {
  const browser = await puppeteer.launch({
	headless: false, 
	executablePath: '/usr/bin/google-chrome-stable',
	args: ['--no-sandbox','--disable-web-security','--disable-gpu', '--hide-scrollbars', '--disable-setuid-sandbox']
  });
  const page = await browser.newPage();
  await page.goto('http://graphemica.com/%E2%A7%81');
  await page.screenshot({path: 'example.png'});
  await browser.close();
})();

What have I tried?

  • Bundled version of Chromium and latest stable Chrome
  • Headless and non-headless

What is the expected result? As rendered on my Windows 7 desktop: image

What happens instead? The icon is not rendered, instead the placeholder box is shown image

Any help would be appreciated, already spent most of the day on this issue.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

37reactions
noinklingcommented, Aug 20, 2018

I found this works for me without having to use the networkidle options:

await page.goto(...);
await page.evaluateHandle('document.fonts.ready');

Documentation is kinda sparse on this browser API, but there’s some more info here: https://stackoverflow.com/questions/5680013/how-to-be-notified-once-a-web-font-has-loaded/32292880#32292880

3reactions
aslushnikovcommented, Jun 29, 2018

I agree with @punkkk - the following works just fine for me on pptr v1.5.0:

const puppeteer = require('puppeteer');

(async() => {
  const browser = await puppeteer.launch({
    headless: false,
    args: ['--no-sandbox','--disable-web-security','--disable-gpu', '--hide-scrollbars', '--disable-setuid-sandbox']
  });
  const page = await browser.newPage();
  await page.goto('http://graphemica.com/%E2%A7%81');
  await page.screenshot({path: 'example.png'});
  await browser.close();
})();
Read more comments on GitHub >

github_iconTop Results From Across the Web

426056 - Ubuntu font renders incorrectly if you have a local ...
1. Ensure that you don't already have the Ubuntu font installed on your system. Import the ubuntu font from google fonts: @import url(//fonts....
Read more >
After installing MS fonts, the fonts are still not the same as on ...
Fonts in Firefox and Chromium are still not the same as in Windows FF and Chrome after installing ms fonts. I mean the...
Read more >
font-face - CSS: Cascading Style Sheets - MDN Web Docs
Chrome Edge @font‑face Full support. Chrome1. Toggle history Full support... OpenType CBDT and CBLC rendering Full support. Chrome66. Toggle history Full support... OpenType COLRv0 rendering Full...
Read more >
Font weight ignored in Chrome - Stack Overflow
This seems to be a Chrome/Chromium bug, caused by having the font installed ... For some reason, it will just load your local...
Read more >
Automatically Install All The Google Web Fonts In Ubuntu ...
I decided not to delete it from the script since you may need it. Update: the script was initially downloading the Google fonts...
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