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.

Non-English characters are showing as rectangle boxes

See original GitHub issue

Steps to reproduce

Environment Details:

  • Puppeteer version: puppeteer-core : 2.0.0
  • Platform / OS version: AWS Lambda
  • URLs (if applicable): http://dir.hinkhoj.com
  • Node.js version: 10

Code that reproduces the issue.

  const browserConfig = {
    args: chromium.args,
    defaultViewport: chromium.defaultViewport,
    executablePath: await chromium.executablePath,
    headless: chromium.headless
  }
  console.log('launching the browser');
  browser = await puppeteer.launch(browserConfig);

  const page = await browser.newPage();
  await page.goto('http://dir.hinkhoj.com');

  await page.screenshot({fullPage: true});

What is the expected result? Website contains Hindi language fonts which are not rendering.

What happens instead? It’s showing Hindi fonts as rectangle boxes. It’s happening on AWS Lambda only.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
alixaxelcommented, May 9, 2020

@theashishranjan Your syntax is off, should be:

await chromium.font('https://rawcdn.githack.com/.../NotoSansDevanagari/NotoSansDevanagari-Regular.ttf');
await chromium.font('yetAnotherFont.ttf');

const browser = await puppeteer.launch({
    args: chromium.args,
    defaultViewport: chromium.defaultViewport,
    executablePath: await chromium.executablePath,
    headless: true
});
1reaction
alixaxelcommented, Jun 8, 2020

@swngarg1308 FYI: since version 3.0.4 the font method accepts paths to local files too and it will symlink them into the correct directory (which should be faster than copying them). Example:

const files = fs.readdirSync('/var/task/fonts');
const chromium = require('chrome-aws-lambda');

for (let file of files) {
    await chromium.font(file);
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Non-English characters are showing as rectangle boxes. #5311
Website contains Hindi language fonts which are not rendering. What happens instead? It's showing Hindi fonts as rectangle boxes. It's happening ...
Read more >
Why does some text display with square boxes in some apps ...
When running certain apps on Windows 10 desktop or Windows 10 Mobile, some characters display as a square or rectangular box, or as...
Read more >
What does it mean when my text is displayed as boxes?
Specifically, the boxes represent characters not supported by the selected font.
Read more >
What symbol is the square box shown for non-representable ...
A rectangle that has an X inside means there is a Unicode character or emoji that is meant to show there, but your...
Read more >
Why do I see boxes when typing in my language?
The “boxes” are a result of the default font style within the titles not supporting the characters of the inputted language.
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