Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Frontend Development

How to Configure Loki Screenshot Tests for an Indian-Language Storybook

By Freedom251 Team · · 6 min read

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

To get reliable Loki screenshots of an Indian-language Storybook, load the intended script-specific font in Storybook’s preview iframe, make sure the font and layout are ready before capture, and compare against deliberately approved reference images. Loki does not provide a universal font-wait setting documented for every release, so verify your installed version and make font loading deterministic in the browser target you use.

What you need before configuring Loki

  • An existing Storybook project and its current Loki setup. Check your installed versions and project configuration before copying commands; Loki’s documentation and command options can vary by release.
  • Node.js 16 or newer, as specified by Loki’s getting-started documentation.
  • A font stack chosen for the actual language and writing system in your stories. A Hindi font choice is not a universal choice for every Indian language.
  • A stable browser target and representative, approved interface text for your baseline stories.

Loki’s web getting-started guide recommends Chrome in Docker; it also documents local Chrome and other targets. Loki does not start Storybook for you: start the development server or serve a built Storybook before running captures. See Loki’s getting-started documentation.

As an Amazon Associate I earn from qualifying purchases.

Initialize Loki and capture a baseline

The following is the documented Yarn workflow. Confirm that the commands and browser configuration match the Loki release already installed in your repository.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Install and initialize: run yarn add loki --dev, then yarn loki init. The initializer detects the project type and adds default configuration to package.json.
  2. Start Storybook: run your project’s normal Storybook server command, or build and serve its static output. Keep it available while Loki captures.
  3. Choose representative stories: include real approved interface copy in the target language, relevant numerals and punctuation, and the text sizes and layout states most likely to expose wrapping or font differences.
  4. Create reference images: run yarn loki update after confirming the intended font and layout render correctly.
  5. Compare changes: run yarn loki test, then inspect the current captures and differences before accepting an update.

Loki documents screenshots and differences under loki/current and loki/difference. Commit references with the code; Loki also documents using Git LFS for reference images. Treat a baseline update as a review decision, not as an automatic way to silence a diff. Workflow details are in Loki’s getting-started guide.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Load the right font in Storybook’s preview iframe

Storybook components render in the preview iframe (also called Canvas), not in the surrounding manager interface. Put font stylesheet links or preload links in .storybook/preview-head.html so they reach the rendering context. If your font files live in a configured static directory, use the path Storybook serves for those assets. Storybook explains the iframe and its head customization in Story rendering.

For example, a project might add a stylesheet link in .storybook/preview-head.html:

<link rel="stylesheet" href="/fonts/app-fonts.css">

The path and stylesheet are illustrative; use the URL and family names actually served by your project. A preload can make a local font available earlier, but it does not prove that the stylesheet requested the intended file or that the browser rendered text with it. Check the font request and computed/rendered family in the browser used for Loki.

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.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Choose a stack for the specific script

Noto’s guidance gives a Hindi sans-serif example using Noto Sans Devanagari, Noto Sans, Noto Sans Symbols 2, and generic sans-serif. Its Tamil example includes Noto Sans Tamil. Adapt the stack to the interface’s actual language and design; a stack for one script should not be treated as a general solution for all Indian-language text. See Noto’s font guidance.

CSS tries later family names when earlier families do not provide needed characters. That fallback is useful for coverage, but it can hide a missing intended font. Make a font-loading failure diagnosable by checking the actual loaded font and by reviewing glyph shape, line breaks, and spacing—not only whether every character appears.

Wait for fonts and layout before capture

If capture begins before web fonts load, Loki can record fallback typography, altered wrapping, or a shifted layout. In browser code you control, await document.fonts.ready before taking the screenshot. MDN states that “The promise fulfills when loading and layout operations of all used fonts are done.” See MDN’s Document: fonts property reference.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

A conceptual page-context readiness check is:

await page.evaluate(() => document.fonts.ready);

This illustrates a browser API readiness gate; it is not a documented Loki configuration key. Use it only in a capture hook or test harness where you control the page object. Storybook’s test-runner documentation describes waitForPageReady(page) for waiting on assets such as fonts before screenshots: Storybook test runner. Loki handles common loading cases in its workflow, but if your fonts load asynchronously or from an external origin, verify readiness in the actual Loki browser target rather than assuming a generic delay is sufficient.

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

Make captures stable and reviewable

Keep the inputs that determine a screenshot consistent between reference creation and comparison:

  • Use the same browser target and Loki configuration.
  • Keep viewport, device scale, language strings, font assets, and story state fixed.
  • Prefer local or otherwise deterministic content over changing network data.
  • Inspect the captured image as well as the difference image; a repeatable fallback-font screenshot is still wrong if the interface is meant to use another font.

Loki says it disables common CSS transitions and animations and requestAnimationFrame by default. It documents limitations including looping animation frames, GIFs, SVG animations, and React Native Animated. Mark unsuitable stories with loki: { skip: true }, or use Loki’s documented asynchronous callback pattern for stories that must signal when rendering is complete. Consult Loki’s flakiness guidance for the configuration supported by your installed release.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Run Loki in CI without creating accidental baselines

Loki’s CI guide gives a static Storybook example that builds the site and requires existing reference images:

yarn build-storybook && yarn loki --requireReference --reactUri file:./storybook-static

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.

--requireReference makes a missing baseline fail rather than letting a comparison job silently create one. Check that --reactUri and the static-build command are appropriate for your framework and installed Loki version. Review reference changes locally and commit them intentionally. See Loki’s continuous-integration guide.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Troubleshoot common screenshot failures

Hindi, Tamil, or other text appears as boxes or unexpected glyphs

  • Confirm the font stylesheet and font asset requests succeed in the preview iframe, not just in the manager UI.
  • Confirm the chosen family covers the target script and that the CSS actually selects it.
  • Check fallback order. A generic fallback may render something while concealing that the intended script-specific face did not load.

Text renders, but line breaks or alignment differ between runs

  • Wait for document.fonts.ready in a custom capture path where available, and verify the actual font request completes in the Loki browser.
  • Hold viewport, device scale, story state, and content constant; font metrics affect wrapping and element dimensions.
  • Look for asynchronous data, animation, or other changing story state before approving a new reference.

Loki cannot connect to Storybook or find the static build

  • Start the Storybook server before a development capture, or build the static site before using a file URI.
  • Check that the URI points to the output directory your build command actually creates and that the option name is supported by the installed Loki release.

CI fails because a reference image is missing

That is the intended protection from --requireReference. Create and review the baseline in the appropriate development workflow, commit it, and rerun CI; do not remove the flag merely to make an unexplained failure pass.

Or skip the browser setup

For a one-off page capture or an independent screenshot alongside visual tests, ScreenshotNeo offers a GET API that returns an image or PDF. Its clean-shot steps can accept consent banners and remove 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, with response headers indicating the page verdict and billing status. It also provides an MCP server with screenshot, page-info, and 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. Loki remains the tool in this guide for Storybook reference-image comparison.

Example cURL request (replace the target URL and API key):

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://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo is a website screenshot API and MCP server made by Yorker Media. Sign up free for 1,000 screenshots a month with no card.

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.

Frontend DevelopmentIndian languagesLokiStorybookvisual regression testingWeb Fonts

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.