The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →To keep Cypress screenshots from capturing fallback fonts, first load the same font styles and files your application uses, wait for the page to reach the intended state, then await document.fonts.ready immediately before capture. That promise covers fonts used in the page and related layout work; it does not guarantee that every declared font has loaded, or that a font injected later will be ready. For late-loaded faces, wait for the specific font as well.
Why fonts make Cypress screenshots inconsistent
A screenshot records the browser’s rendered pixels. If a web font has not loaded when Cypress captures the page, text may render in a fallback face instead. The fallback can change letter widths, line breaks, element heights, and the positions of everything below the text. A test can therefore fail visually even when its application data and component behavior are otherwise correct.
Font readiness is only one part of screenshot stability. Differences in test data, browser or operating system, installed fonts, display scaling, viewport, and animation state can also change pixels. A reliable workflow controls both the page’s readiness and the rendering environment.
Make the test page use the real font setup
Start by ensuring the page under test loads the same font stylesheets and @font-face declarations as production. Waiting cannot fix a stylesheet that the test never includes or a font file that the server cannot deliver.
Recommended Free Tools
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
For component tests
Cypress component tests need the application’s font styles in the component test document, commonly through component-index.html or the component support setup. If production links to an external font stylesheet, include the corresponding link in the test document. If production defines local faces in a stylesheet, make sure that stylesheet is imported or otherwise included in the component test setup.
For local font files
Check that the component dev server can serve the font assets. Vite can serve files from its public directory. With Webpack, font assets generally need to be imported or exposed through an explicit static directory. The exact path depends on the application’s setup; verify the browser’s network requests rather than guessing at a longer wait.
Open the browser’s network panel while the Cypress test runs and look for failed font requests, especially 404 responses. Correct the URL, import, or static-directory configuration first. If the request fails, neither document.fonts.ready nor an arbitrary delay can make the intended face available.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Wait for application state and used fonts before capture
cy.visit() waits for the page load event and the loading phase for external resources, but that alone is not a complete screenshot synchronization strategy. Fonts may be injected or loaded lazily, and the application may still be changing after the page event. Combine an application-specific readiness assertion with the browser’s font readiness promise.
cy.visit('/page')
cy.get('[data-cy="page-ready"]').should('be.visible')
cy.document().then((doc) => {
return cy.wrap(doc.fonts.ready)
})
cy.screenshot('page-with-fonts')
Replace /page and [data-cy="page-ready"] with the route and a meaningful signal from your app. The assertion should indicate that the content and layout you intend to compare are present—not merely that the document exists. The font wait then synchronizes capture with loading and layout operations for fonts the page uses.
Why this is better than a fixed sleep
A fixed delay guesses how long a particular machine or run will take. It can be unnecessarily slow when fonts load quickly and still too short when they do not. Waiting for an application condition and a browser readiness promise expresses what must be true before capture, rather than assuming it will be true after a chosen number of milliseconds.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Target a face that appears after initial render
If the application introduces a particular font after the initial render, request that face explicitly with document.fonts.load(), then wait for the app’s readiness assertion before taking the screenshot. For example:
cy.visit('/page')
cy.document().then((doc) => {
return cy.wrap(doc.fonts.load('400 16px "Brand Sans"'))
})
cy.get('[data-cy="page-ready"]').should('be.visible')
cy.document().then((doc) => cy.wrap(doc.fonts.ready))
cy.screenshot('page-with-brand-sans')
Use a font specification and family name that match the face your page actually uses. This pattern asks the browser to load the requested face; it does not compensate for an unavailable file or incorrect font declaration. Keep the application assertion: font availability does not prove the page’s data and layout have reached the desired state.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsUnderstand the limits of document.fonts.ready
The browser’s document.fonts.ready promise fulfills after loading and layout operations for fonts used by the document have finished. It does not mean every font declared in stylesheets has loaded: a declared face that is not used may remain unloaded. That distinction matters if a component, route, or interaction applies a face only later.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
There is another edge case: the CSS Font Loading specification allows the ready promise to fulfill once, while additional fonts may load afterward. If your application injects a new font after the first readiness event, do not assume an earlier document.fonts.ready check covers it. Expose an application-level “fonts ready” state, or make a targeted document.fonts.load() call immediately before capture and then wait for the resulting readiness work.
For pages with multiple capture states, run the readiness steps for each state at the point it is actually ready to be captured. A font wait performed before a later interaction cannot guarantee that a newly introduced face is ready afterward.
Keep the rendering environment fixed
Once the page itself is synchronized, make baseline and comparison runs use the same rendering conditions. Pin the browser and container image, use a fixed viewport and device scale, and keep installed fonts consistent. Differences between operating systems or browser environments can affect text rendering even when the same font files load successfully.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
- Browser and operating system: Use the same pinned browser/container image for baseline creation and later comparisons.
- Viewport and scale: Keep viewport dimensions and device scale fixed, since both influence text wrapping and pixel output.
- Installed fonts: Keep the environment’s installed fonts stable, particularly if the page uses system fonts or fallback stacks.
- Animations: Disable CSS transitions and animations in the test environment or wait for them to finish before capture. A command-level
waitForAnimationssetting affects action commands; it does not by itself ensure that a screenshot taken elsewhere happens outside an animation. - Test data: Hold data and page state constant between the baseline and the comparison run.
Troubleshoot font-related screenshot failures
| Symptom | Likely cause | What to check or change |
|---|---|---|
| Text appears in a serif or other fallback face | The intended font stylesheet or font file is missing, failed, or not ready at capture time. | Check the browser network panel for failed font requests and 404s. Confirm the test document includes the production font styles and that local assets are served by the component dev server. Then add the application assertion and font wait. |
| The wait completes, but a later view still uses a different face | The application introduces or applies the face after the first document.fonts.ready promise fulfilled. |
Wait for the app-level state for that view and call document.fonts.load() for the specific face immediately before capture. |
| Component tests fall back, but the application route looks correct | The component test document or support setup does not include the same styles, or its server does not expose the font assets. | Add the relevant external font link or local stylesheet to component-index.html or component support setup. Check the asset path and dev-server configuration. |
| Text looks different despite successful font loading | The baseline and current run differ in browser, operating system, installed fonts, viewport, device scale, or test data. | Pin the rendering environment and keep the viewport, scale, fonts, and data the same across runs. |
| Only some captures show shifted content | A transition or animation is in progress during capture, or the application has not reached the same state each time. | Disable CSS motion in the test environment or wait for it to finish, and assert the intended application state before capture. |
Or skip the browser setup
If you need a screenshot of a URL rather than a Cypress visual test, ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF. Here is a cURL example:
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 request options. It accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. 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 screenshots.
Sign up for 1,000 free screenshots a month, with no card required.
Choose the right readiness check for the page
For a page whose fonts are loaded through the initial document and used in the intended view, an application assertion followed by document.fonts.ready is a practical capture boundary. For a face applied or injected later, target it with document.fonts.load() and synchronize with that later application state. In either case, fix missing font assets and stabilize the browser environment; waiting alone cannot make two different rendering environments produce identical pixels.
Frequently Asked Questions
Does document.fonts.ready load every font declared by the page?
No. It covers loading and layout operations for fonts used by the document; an unused declared face can remain unloaded.
Why can a font load after document.fonts.ready has resolved?
The ready promise may fulfill once, and an application can introduce additional fonts afterward. For a late face, request it with document.fonts.load() and coordinate capture with the app’s later ready state.
Should I use a fixed timeout instead of a font readiness check?
A timeout is only a guess about how long loading takes. Prefer an assertion for the intended application state plus the browser’s font readiness signal.
Quick Recap
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.

