Recommended Free Tools
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
PhantomJS renders Hebrew correctly only when three separate layers agree: a Hebrew-capable font is available to the PhantomJS process, the document and text runs declare the right direction, and the shaping engine can position Hebrew marks. A CSS font-family declaration alone cannot provide missing glyphs or repair bidirectional (bidi) ordering.
Work through the layers in that order, test the exact runtime image that creates the screenshot, and inspect the final pixels. The procedure below covers unvocalized and vocalized Hebrew, mixed Hebrew/Latin text, Linux font installation, common failure modes, and the limitations of an archived renderer.
What must work for Hebrew to appear correctly
Font discovery is a runtime problem
The font named in CSS must exist where the PhantomJS process runs, not merely on your workstation. Fontconfig provides system-wide font configuration and application access; its matcher selects the closest available pattern. A successful match does not prove that the chosen face looks like your requested family or contains every Hebrew character.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsCheck the actual runtime image, user account, and font search path. A container, CI worker, or service account can see a different set of fonts than an interactive shell. Confirm both the family and the glyphs used by the page. If the text contains niqqud (vowel points) or cantillation marks, those marks need coverage too.
#1 Best Overall
Direction and shaping are separate from glyph coverage
Hebrew is written right to left. Mixed runs containing Hebrew, Latin, punctuation, or numbers require bidi direction tracking. The shaping engine also performs mark reordering and mark-to-base positioning for Hebrew. Base letters can look correct while punctuation is in the wrong order or marks float, overlap, or disappear.
PhantomJS is an old rendering target
The PhantomJS GitHub repository has been archived and is read-only; GitHub records the archive date as May 30, 2023. Treat any workaround as specific to your PhantomJS build and operating-system image, and consider a maintained browser for new systems.
How to make PhantomJS find and use a Hebrew font
- Identify the exact font family. Record the CSS family and weight/style actually requested. Remove accidental fallbacks such as a font name that differs only by spelling or capitalization.
- Verify installation inside the renderer environment. Inspect the container or host used by PhantomJS, not your development desktop. Confirm that the font files are readable by the account launching PhantomJS.
- Verify character coverage. Test every character in production strings, including final Hebrew forms, punctuation, niqqud, and cantillation marks. A font can contain Hebrew letters but omit combining marks.
- Refresh the font index when installing files. On Linux, a 2017 PhantomJS issue comment reports copying TTF files to
/usr/share/fonts/truetypeand runningfc-cache -fv. This is an anecdotal, environment-specific report—not a universal PhantomJS procedure. Distribution packages, directories, permissions, and cache locations vary, so validate the result on your image. - Restart PhantomJS. Start a new process after changing fonts. Do not assume a long-running process will notice a newly rebuilt font cache.
- Capture a diagnostic page. Render a page containing the exact Hebrew strings, the requested family, a known fallback, mixed Hebrew/Latin text, and (if applicable) vocalized text. Compare the output at the same viewport and scale as production.
Minimal PhantomJS diagnostic script
Save this as hebrew-check.js and run it with your PhantomJS executable. Replace the family and strings with your production values.
var page = require('webpage').create();
page.viewportSize = { width: 1000, height: 500 };
page.open('file:///absolute/path/hebrew-check.html', function (status) {
if (status !== 'success') {
console.log('open failed: ' + status);
phantom.exit(1);
}
page.render('/absolute/path/hebrew-check.png');
phantom.exit();
});
The HTML fixture should explicitly set language and direction:
<!doctype html>
<html lang="he" dir="rtl">
<head>
<meta charset="utf-8">
<style>
body { font-family: "Your Hebrew Font", sans-serif; }
.mixed { direction: rtl; unicode-bidi: plaintext; }
.latin { direction: ltr; unicode-bidi: isolate; }
</style>
</head>
<body>
<p>שלום עולם</p>
<p class="mixed">שלום ABC 123 — 2026</p>
<p>שָׁלוֹם</p>
</body>
</html>
Use the markup that matches your application rather than copying these classes blindly. The important checks are an explicit lang, an appropriate RTL context, and deliberate handling of embedded LTR runs.
Rank #2
Why Hebrew text is backwards or punctuation is misplaced
Set direction at the right scope
For an all-Hebrew document, <html lang="he" dir="rtl"> establishes the default. For a component, set dir="rtl" on the component or its containing element. Keep embedded English identifiers, URLs, or code in an LTR span and isolate them so surrounding Hebrew does not reorder their punctuation.
Test bidi cases, not just a headline
Include Hebrew followed by an English product name, a URL, parentheses, a date, and a number. Screenshot inspection is essential: DOM text order and visual order are different concepts in bidi layout. If one string fails, reduce it to a minimal case and add characters back until the direction boundary causing the problem is clear.
Do not use PDF settings as a shaping fix
PhantomJS’s paperSize API controls dimensions, margins, formats, orientation, and headers/footers. Those layout settings cannot supply missing glyphs or correct bidi and mark shaping. Fix the font and markup before adjusting page size.
Why Hebrew vowel points or cantillation marks are missing
Check the actual code points
Niqqud and cantillation are combining marks. Confirm that the source is valid Unicode and that the selected font contains the marks. A fallback may supply base letters while leaving combining marks unsupported.
Check mark positioning at output size
Hebrew OpenType shaping includes mark reordering and mark-to-base positioning. A mark may technically exist but render in an unusable position at the final screenshot size. Inspect a 1:1 crop of the output, then test a larger font size to distinguish clipping or antialiasing from a shaping failure.
Rank #3
Compare fonts, not only CSS names
Fontconfig can select a visually unsuitable fallback even when matching succeeds. Test a known Hebrew-capable family and compare the exact glyph forms and mark placement required by your design. If you license a commercial face, install it in the runtime image and verify that its license permits server-side rendering.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Linux installation: a cautious, reproducible workflow
Because the title does not specify an Ubuntu release, distribution, container base, or PhantomJS build, there is no single definitive package command. Use this workflow:
- Copy the approved TTF/OTF files into the font directory used by your image. The historical Linux report used
/usr/share/fonts/truetypefor TTF files. - Run the cache refresh command appropriate to that image. The reported workaround used
fc-cache -fv. - Check the cache and family name from the same user and container that launch PhantomJS.
- Run the diagnostic fixture and compare screenshots before deploying.
- Bake the fonts and cache refresh into the image build so a fresh worker is identical to a local test.
Do not treat the reported directory or command as portable documentation. Some distributions use different paths, package-managed fonts, or per-user caches. Permissions and sandboxing can also prevent PhantomJS from reading files that exist on disk.
Troubleshooting by symptom
| Symptom | Likely cause | Fix |
|---|---|---|
| Boxes or blank spaces replace Hebrew | No installed font covers the characters, or the process cannot read it. | Install a Hebrew-capable face in the runtime image, refresh the cache, restart PhantomJS, and test permissions and coverage. |
| Letters appear but the family is wrong | Fontconfig selected a fallback that matches the pattern but not the intended design. | Verify the family name and weight, remove conflicting fonts, and inspect the selected face in the actual image. |
| Hebrew reads in the wrong visual order | Missing or misplaced RTL metadata; mixed-direction runs are not isolated. | Set lang="he" and dir="rtl"; isolate embedded LTR text and test punctuation and numbers. |
| English fragments or URLs jump around | Bidi boundaries are ambiguous. | Wrap the fragment in an LTR element with explicit bidi isolation and keep the surrounding Hebrew RTL. |
| Niqqud or cantillation is absent | The font lacks combining marks, or shaping/positioning fails. | Choose a font with the required marks, verify Unicode input, and inspect at final size. |
| Font works locally but not in CI | Different image, user, cache, or permissions. | Install and cache fonts during image build; run the same diagnostic fixture in CI. |
Changing paperSize changes nothing |
Paper settings affect output geometry, not glyph selection or bidi shaping. | Return to font availability, direction metadata, and shaping tests. |
Reliability and performance considerations
Make rendering deterministic
Pin the PhantomJS binary, operating-system image, font files, and font-cache build step. Record the viewport, device scale, and screenshot format. A font update can change line breaks and therefore the entire full-page image even when HTML is unchanged.
Wait for the page state you actually need
Capture only after the Hebrew content is present and styles have loaded. If fonts are injected or content is asynchronous, add an application-level readiness signal and wait for it before rendering. A screenshot taken before the final font is available can permanently capture fallback glyphs.
Rank #4
Keep a visual regression fixture
Include unvocalized Hebrew, vocalized Hebrew, mixed Hebrew/Latin, punctuation, and numbers. Compare crops as well as the whole page. This catches mark displacement and bidi regressions that ordinary DOM tests miss.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When to replace PhantomJS
For a legacy pipeline, the checks above can stabilize an existing PhantomJS image. For a new service, its archived, read-only status is a material maintenance risk. A maintained browser engine generally offers a more current shaping stack and security updates. If you must remain on PhantomJS for compatibility, isolate it, pin its environment, and treat Hebrew rendering as a tested artifact rather than an assumption.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server, so you can request a rendered image without managing a PhantomJS font environment. Its cleanup step accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.
One GET request returns PNG, JPEG, WebP, or PDF. The API supports full-page capture with lazy images, CSS-selector element capture, dark mode, device presets or custom viewports, retina scale, custom CSS and JavaScript, click-before-capture actions, selector hiding, selector/delay/network-idle waits, request and resource blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage data, and an OpenAPI specification. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
See the ScreenshotNeo documentation for authentication and options. This cURL example captures a Hebrew page:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/hebrew -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/hebrew"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/hebrew' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
require('fs').writeFileSync('shot.webp', Buffer.from(await res.arrayBuffer()));
ScreenshotNeo includes 1,000 shots per month free with no card; paid plans start at $5 for 3,000 shots, and yearly billing gives two months free. Create a free ScreenshotNeo account to try it.
Best Value
- Used Book in Good Condition
Frequently Asked Questions
Can CSS alone install a Hebrew font for PhantomJS?
No. CSS can request a family, but the font files must be available and readable in the PhantomJS runtime. Web-delivered fonts can work only if that runtime successfully loads them before capture.
Should I use a system font or a web font?
Choose based on reproducibility in your deployment image. System installation avoids a network dependency; web delivery keeps the asset with the page. In either case, verify glyph coverage, mark positioning, bidi behavior, and the final screenshot in the target runtime.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Does a successful fontconfig match prove Hebrew will look correct?
No. Matching only means a font pattern was selected. You still need the required Hebrew letters and marks, suitable visual forms, and correct shaping.
Is the Linux TTF workaround guaranteed on Ubuntu?
No. The reported installation path and fc-cache -fv command come from a 2017 issue comment and are environment-specific. Test them against your Ubuntu release, container, permissions, and PhantomJS build.
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.

