Different font family between headless and headful
Reported by
pp.miz...@gmail.com,
Oct 18 2017
|
|||||
Issue descriptionChrome 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
,
Oct 23 2017
,
Oct 24 2017
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
,
Oct 31 2017
,
Dec 4 2017
pp.mizdra@ Could you please respond to the comment #3
,
Jan 4 2018
[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 |
|||||
Comment 1 by shrike@chromium.org
, Oct 20 2017