Comparison

Why Generic Image APIs
Fail at Arabic Text

Puppeteer, wkhtmltoimage, and Cloudinary weren't built for Arabic. Broken diacritics, wrong ligatures, and mangled RTL layout are the norm — not the exception.

Mirqam vs Generic Image APIs

An honest comparison of Arabic text rendering capabilities.

FeatureMirqamPuppeteer / wkhtmltoimageCloudinary
RTL layout supportNative — built for RTLDepends on OS/fontsPartial — often broken
Diacritics (tashkeel)Pixel-perfect positioningOften mispositionedFrequently broken
OpenType shapingFull (ligatures, kashida, contextual forms)Depends on OS librariesLimited
Custom fonts (TTF/OTF)Upload and use instantlyInstall on server manuallyPaid feature, limited shaping
Deterministic outputIdentical across all environmentsVaries by OS and browser versionGenerally consistent
Speed (per image)Milliseconds — no browser overheadSeconds — headless Chromium startupSub-second — cloud processing
API simplicitySingle REST call with JSON bodyCustom code + HTML templateURL-based transforms, complex for text

Why Arabic Text Rendering Is Hard

Arabic isn't just "right-to-left English." It requires a completely different text shaping pipeline.

Contextual Letter Forms

Each Arabic letter has up to 4 forms (initial, medial, final, isolated) depending on position. Generic renderers often pick the wrong form, breaking the cursive flow.

Diacritics Positioning

Harakat (fatha, damma, kasra, shadda) must be positioned precisely above or below letters using OpenType GPOS tables. Without proper mark positioning, diacritics float in the wrong place.

Ligatures & Kashida

Arabic fonts contain mandatory ligatures (like lam-alef) and optional ones for aesthetic quality. Kashida (elongation) is used for justified text. Both require OpenType GSUB support.

Bidirectional Text

Mixing Arabic with English or numbers requires the Unicode Bidirectional Algorithm. Incorrect BiDi handling causes text to appear in the wrong order — a common issue with image-generation APIs.

Font Fallback Chains

Server environments typically lack Arabic fonts. Without proper fallback chains, you get tofu (missing glyph boxes) or substitution with a system font that doesn't match your design.

Cross-Platform Consistency

Puppeteer output varies between macOS, Linux, and Docker containers because each uses different text shaping libraries. Mirqam produces identical output everywhere.

Common Questions About Arabic Rendering

Why does Puppeteer render Arabic diacritics incorrectly?

Puppeteer relies on the underlying OS text shaping engine and installed fonts. Most server environments lack proper Arabic fonts and OpenType shaping support, causing diacritics (tashkeel) to appear disconnected or mispositioned.

Can Cloudinary handle Arabic text overlays?

Cloudinary supports basic text overlays, but its rendering engine does not handle Arabic ligatures, kashida, or diacritics positioning correctly. Characters may appear disjoined or in the wrong order.

What makes Arabic text rendering so difficult?

Arabic is a cursive script where letters change shape based on position (initial, medial, final, isolated). Add diacritics (harakat), kashida (elongation), and RTL layout, and you need a full OpenType shaping engine — not just font rendering.

Does Mirqam support custom Arabic fonts?

Yes. Upload any TTF or OTF font file directly. Mirqam's rendering engine applies full OpenType shaping including ligatures, contextual alternates, and mark positioning — ensuring your custom font displays exactly as the type designer intended.

How fast is Mirqam's API compared to Puppeteer-based solutions?

Mirqam generates images in milliseconds without spinning up a headless browser. Puppeteer-based solutions require launching Chromium, loading a page, and taking a screenshot — typically 2-10x slower and far more resource-intensive.

Stop Fighting Arabic Text Rendering

One API call. Perfect Arabic every time. Sign up and get 100 free credits to test with your own fonts and templates.

Why Generic Image APIs Fail at Arabic Text — Mirqam vs Puppeteer, Cloudinary | مِرقم