New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 775794 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Different font family between headless and headful

Reported by pp.miz...@gmail.com, Oct 18 2017

Issue description

Chrome Version       : 61.0.3163.100
OS Version: OS X 10.12.6

What steps will reproduce the problem?
1. Open headless/headful browser with puppeteer
2. Goto the site without css (ex. http://info.cern.ch)
3. Print fontfamily

Test codes
```
// $ npm install puppeteer && node test-codes.js
const puppeteer = require('puppeteer');

const url = 'http://info.cern.ch';
const selector = 'h1';

const getFontProperty = async (page) => {
  const font = await page.evaluate((selector) => {
    const title = document.querySelector(selector);
    return getComputedStyle(title).font;
  }, selector);
  return font;
}

const printFontProperty = async (headless) => {
  const browser = await puppeteer.launch({headless: headless});
  const page = await browser.newPage();
  await page.goto(url);
  await page.screenshot({path: `headless-${headless}.png`});
  console.log(await getFontProperty(page));
  await browser.close();
}

(async () => {
  await printFontProperty(true);
  await printFontProperty(false);
})();
```


What is the expected result?
Default fonts in the screenshot are same between headless and headful.


What happens instead of that?
`Times New Roman` is used in headless, however `Hiragino Kaku Gothic ProN` is used in headful.


Font config (Chromium)
- Standard font: Hiragino Kaku Gothic ProN
- Serif font: Hiragino Mincho ProN
- Sans-serif font: Hiragino Kaku Gothic ProN
- Fixed-width font: Osaka


Reference
- https://github.com/GoogleChrome/puppeteer/issues/922


UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36



 
headless-true.png
28.8 KB View Download
headless-false.png
35.1 KB View Download

Comment 1 by shrike@chromium.org, Oct 20 2017

Labels: Needs-Feedback
[macbugtriage] Is there a way to print out or see the font settings in the headful and headless cases? I suspect the font configuration in the headless case is not as expected.
Components: Internals>Headless Blink>Fonts
Cc: dvallet@chromium.org
I'm not able to reproduce your bug, both headless and non-headless appear with Times New Roman. 

I your non-headless instance has its own font config, this won't be picked up by headless. To check if that's the case, try using a different (empty/random) user data directory for non-headless

Comment 4 by e...@chromium.org, Oct 31 2017

Components: -Blink>Fonts
pp.mizdra@ Could you please respond to the comment #3
Status: WontFix (was: Unconfirmed)
[mac bug triage] Closing from lack of response for over 30 days. Feel free to reopen if you have additional info.

Sign in to add a comment