Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Wait for the page’s target text to appear, then wait for the browser’s used fonts and layout to settle before calling page.screenshot(). If a particular font is essential, explicitly request that face and check that it loaded; document.fonts.ready alone does not prove the preferred font was used.

Capture the page after its content and fonts are ready

This runnable example uses Puppeteer’s JavaScript API. Replace the example URL and selector with the page and component you need to capture. The selector is page-specific: choose one that appears only after the relevant Indian-language text has rendered.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });

  // Replace with a selector for the actual content to capture.
  await page.waitForSelector('[data-screenshot-content]', { visible: true });

  // Wait for used fonts and their related layout work.
  await page.evaluate(async () => {
    await document.fonts.ready;
  });

  await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
  await browser.close();
}

Puppeteer’s documentation describes navigation, waiting, and screenshots; its Page API covers page operations such as screenshot(). DOMContentLoaded is only a navigation milestone: it does not guarantee client-rendered content is present, so wait for the component or text you intend to capture.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Request a particular font when it is required

If the screenshot must use a specific face, request it after the content is present and before capture. Use the exact CSS family name, weight, and representative text for the relevant script:

await page.evaluate(async () => {
  const sample = document.querySelector('[data-screenshot-content]')?.textContent ?? '';
  const faces = await document.fonts.load('400 16px "Noto Sans Devanagari"', sample);
  await document.fonts.ready;
  return faces.map(face => ({ family: face.family, status: face.status, weight: face.weight }));
});

This family is an example for Devanagari text only, and only if the page actually configures it. Substitute the face and weight used by your page. Check the returned face statuses and, when fidelity matters, inspect the rendered output. A resolved readiness promise does not certify that the preferred face loaded or that every required glyph came from it.

What document.fonts.ready confirms

The browser exposes a FontFaceSet as document.fonts. Its ready promise fulfills after loading and layout operations for fonts used in the document have completed, as MDN explains in its Document fonts property reference. A declared face that the rendered content does not use may remain unloaded. Optional font-display behavior can also affect whether a face is used.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

For dependable capture, first wait for the actual text or component, then await document.fonts.ready. If a specific face matters, explicitly call document.fonts.load() with a CSS font shorthand and representative text, inspect the result, and verify the screenshot. Network-idle waits can help on some pages, but neither network idle nor a navigation event proves correct font selection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a font stack for the page’s scripts

“Indian-language” can mean several scripts; it is not a single font choice. Pick families and weights for the languages actually displayed, including needed punctuation, digits, and symbols. Noto recommends script-specific families and selecting only the scripts a site uses. Its web-font guidance includes examples for Hindi and Tamil and explains adding selected families through Google Fonts or using family names in CSS: Use Noto fonts on the web.

body {
  font-family: "Noto Sans Devanagari", "Noto Sans", sans-serif;
}

For Tamil, use the corresponding Tamil family; for other scripts, select the matching family. A single-script stack may not cover a page containing multiple scripts, or all punctuation and symbols. Choose a stack that matches the content rather than assuming one family covers everything.

Hosted versus self-hosted fonts

Whether a font is hosted by a web-font provider or served by your application, make sure the requested family and weight match the CSS and that the font file can be reached from the browser runtime taking the screenshot. With a self-hosted font, check the @font-face family name, declared weight, file URL, and network response. A missing face, failed request, or missing glyph coverage can lead to fallback rendering. Verify the page’s font status and network activity instead of guessing from the screenshot.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Troubleshoot missing or incorrect glyphs

  • The screenshot shows fallback lettering: Confirm the target text is present before waiting for fonts, then inspect document.fonts.load() results and the font request in the browser’s network activity. Check that the CSS family name and weight match the configured face.
  • Some characters look different or appear as boxes: Check whether the selected font covers the specific script, punctuation, digits, and symbols in the captured text. A family name alone does not establish glyph coverage.
  • The page is captured before text appears: Wait for a selector or predicate tied to the actual asynchronously rendered component. A successful navigation milestone does not guarantee client-side content has finished rendering.
  • It works locally but not in CI or a container: Check font-file reachability and rendering in the actual browser/runtime used for capture. The result can depend on that environment; validate there rather than assuming local output transfers exactly.
  • document.fonts.ready resolves, but the intended font is not used: Readiness covers fonts used in the document, not every declared face. Explicitly request the required face for representative text, inspect its status, and check the rendered screenshot.

Or skip the browser setup

ScreenshotNeo can capture a page through one GET request. The API accepts screenshot parameters, including a target URL; see the ScreenshotNeo documentation for setup and options.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers indicate the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Does document.fonts.ready guarantee the preferred font loaded?

No. It resolves after loading and layout work for fonts used in the document; explicitly request and check a critical face.

Should I wait for networkidle before a Puppeteer screenshot?

It can help on some pages, but it does not confirm that the target content is present or that the intended font rendered.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.