DOMRander — A DOM to Canvas renderer focused on RTL and Persian/Arabic text

Author: fouad-salehiCreated Sep 9, 2026Updated Sep 9, 2026

Hi,

I recently built DOMRander, a dependency-free DOM to Canvas renderer inspired by the general idea of rendering HTML/CSS content onto a Canvas.

The main focus of the project is handling Persian, Arabic, RTL, mixed RTL/LTR, and Unicode text rendering in browser-based DOM-to-Canvas rendering.

What DOMRander currently supports HTML to Canvas rendering Persian and Arabic RTL text Mixed RTL / LTR content Unicode characters Custom fonts Backgrounds and linear gradients Borders and border-radius Box shadows Opacity CSS transforms Basic overflow clipping Canvas, DataURL, and Blob output Zero dependencies Rendering options

DOMRander provides several rendering options for different use cases:

Render a DOM element directly to Canvas Export the rendered result as a PNG Generate a Data URL Generate a Blob Control the rendering scale Configure background rendering Support custom fonts and browser-loaded fonts Project

GitHub: https://github.com/fouad-salehi/DOMRander

Example

The project includes a playground where the same DOM can be viewed in the browser and rendered through DOMRander to Canvas.