import React from 'react'; import {AbsoluteFill, HtmlInCanvas, Img, staticFile} from 'remotion'; // Port of https://github.com/WICG/html-in-canvas/blob/main/Examples/complex-text.html — // demonstrates rasterizing rich text (RTL, vertical writing mode, emoji, // inline `` and inline ``) through `drawElementImage`, then // applying a 2D-context rotation/translation to the bitmap. export const HtmlInCanvasComplexText: React.FC = () => { return ( { const ctx = canvas.getContext('2d'); if (!ctx) { throw new Error('Failed to acquire 2D context'); } ctx.reset(); ctx.rotate((15 * Math.PI) / 180); ctx.translate(160, -40); ctx.drawElementImage(elementImage, 0, 0); }} >
Hello from{' '} html-in-canvas!
I'm multi-line, formatted, rotated text with emoji (😀), RTL text من فارسی صحبت میکنم, vertical text,

这是垂直文本

an inline image ( inline ), and{' '} SVG !
); };