CaptureKit Screenshots Render Hindi Text as Boxes: How to Fix Fonts
Fix Hindi text that appears as boxes in CaptureKit screenshots by checking Devanagari font coverage, blocked font requests, and capture timing.
If Hindi text appears as empty boxes in a CaptureKit screenshot, check three things first: whether the page loads a font with Devanagari glyph coverage, whether the capture request blocks font resources, and whether the screenshot starts before fonts finish loading. The available documentation describes these possible causes and relevant capture controls; it does not establish a confirmed CaptureKit-specific Hindi rendering defect. The actual cause depends on the target page and request.
Use the checklist below to isolate the cause before changing the page or capture settings.
1. Confirm the problem in a normal browser
- Open the exact target URL in a browser and check the Hindi text.
- If it also appears as boxes there, investigate the page’s font stack, font files, and delivery. The screenshot service cannot render glyphs that the page’s available fonts do not provide.
- If the browser renders it correctly, capture the page with the same URL and compare the screenshot. Keep the viewport and other capture settings consistent.
Inspect the affected element’s computed font-family in browser developer tools. Check the browser’s network panel for the stylesheet and font-file requests, including failed requests. Confirm that the font actually selected for the Hindi text covers Devanagari; a font name in the CSS stack alone does not prove that its file loaded or contains the needed glyphs.
2. Make sure CaptureKit is not blocking fonts
CaptureKit’s API reference documents resource-type blocking, including the font type, and URL-pattern blocking. Review the capture request for settings such as block_resources=font and any block_urls pattern that could match the page’s font stylesheet or font host. Allow the necessary font requests, then capture again. CaptureKit API reference
Blocking fonts may be intentional to reduce page weight, but it can leave text without the glyphs needed to render. If you use URL patterns to block trackers or other resources, check that a broad pattern is not also catching a font CDN or stylesheet.
3. Wait for fonts before capturing
CaptureKit documents wait_until, wait_for_selector, and a delay parameter. These can help when a page is still loading, but a selector appearing does not necessarily mean its web fonts are ready. The API reference does not say that CaptureKit automatically waits for document.fonts.ready. CaptureKit API reference
When your own browser automation gives you page-script access, wait for the browser’s font readiness promise before taking the screenshot:
await page.goto(url, { waitUntil: 'networkidle' });
await page.evaluate(() => document.fonts.ready);
await page.screenshot({ path: 'hindi.png', fullPage: true });
document.fonts.ready resolves after document fonts have loaded, layout operations have completed, and no further font loads are needed. It is a useful readiness check in browser automation, but do not assume a hosted screenshot API exposes page scripting or performs this wait unless its documentation says so. MDN: FontFaceSet.ready
If you cannot run page script in your CaptureKit flow, try a suitable documented wait condition or a short delay as a diagnostic. A delay can help identify a timing problem, but it is not as precise as confirming font readiness and may make every capture slower.
4. Compare captures consistently
Browser screenshots can vary with the host operating system, browser version, settings, hardware, and headless mode. When comparing a normal browser view with a CaptureKit screenshot, use the same environment where possible and change one factor at a time: font requests allowed or blocked, capture immediately or after fonts are ready, and the same or different browser environment. Playwright: Visual comparisons
5. Troubleshooting checklist
| Symptom | Likely area to inspect | Next step |
|---|---|---|
| Hindi is boxed in both the browser and screenshot | Page font coverage or font delivery | Inspect computed font styles and font requests; fix the page’s font configuration or delivery. |
| Browser looks correct, screenshot has boxes | Capture resource rules or timing | Allow font resources and check URL blocking patterns; then wait for fonts where possible. |
| Some Hindi characters render and others do not | Incomplete glyph coverage or fallback behavior | Inspect the actual font used for the affected text and whether fallback fonts load. |
| Adding a delay changes the result | Capture may start before fonts or layout settle | Use a more specific readiness condition if available; with browser scripting, await document.fonts.ready. |
| Results differ across machines or runs | Different browser or host environment | Repeat under consistent browser, host, settings, and capture parameters. |
| Font requests fail in the network panel | Font URL, delivery, or access problem | Check the request’s status and page configuration; ensure the capture environment can fetch the required font. |
If fonts load successfully and the page renders correctly in the same environment, but CaptureKit still produces boxes, collect the target URL, capture parameters, timestamp, and a minimal reproducible page when contacting CaptureKit support. This is a practical escalation checklist, not a vendor-documented support procedure.
6. Performance, reliability, and cost considerations
- Allow only what the page needs. Unblocking fonts can add network requests. Prefer correcting an overly broad block rule over disabling unrelated resource controls.
- Use readiness checks instead of large fixed waits where possible. A fixed delay adds that time to every capture and can still be too short on a slow page. Waiting for fonts in browser automation ties the capture to the browser’s font-loading and layout readiness signal.
- Keep comparison conditions stable. Browser and host differences can create visual changes unrelated to the font fix, so compare like-for-like captures.
- Do not infer a vendor defect from one page. The cause can be page-specific font configuration, blocked requests, timing, or environment differences. The available sources do not identify which applies to a particular URL.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. Its API can return an image or PDF from a single GET request. For example, this cURL request captures a page as WebP:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for parameters. The API also accepts the parameter names used by other screenshot APIs, which can make switching easier. ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before the shot; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is available on every plan. Sign up for 1,000 free screenshots a month, with no card.
FAQ
Does a longer delay always fix Hindi boxes?
No. A delay can help diagnose a font-loading race, but it cannot add missing Devanagari glyphs or undo a blocked font request.
Does a visible text element mean its font loaded?
No. The element can appear before its web font finishes loading. Check font requests or, where browser scripting is available, await document.fonts.ready.
Can these sources confirm CaptureKit has a Hindi rendering bug?
No. They document relevant API controls and general browser behavior, not a confirmed defect or the cause on a specific page.


