Skip to content

Explore using Satori and resvg to render images #5

Description

@dtinth

Problems with using canvaskit-wasm:

canvas kit-wasm seems to not support multi-fonts and also the fallback font.

Because of this we cannot easily render emoji… Otherwise we must build our own font switching algorithm.

The current image generation code was created before Satori was released so the tool choice you see here is quite outdated (the upside is that it is lightweight (no need to fire up Google Chrome to take a screenshot) and it is cross platform (all wasm, no need for native libs, and fonts render the same way on all platforms)).

Going forward one way to improve the image generation may be to use something like Satori + resvg (Vercel does this). But IMO it’s not a high priority.

What to explore

  • Can Satori wrap Thai words?
  • Can Satori render emoji mixed with Thai text?
  • Can Satori render text with tone marks properly placed? e.g. วรรณยุกต์ไม่ลอย

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions