imgoji
    Preparing search index...

    Class Renderer

    Renders imgoji strings to a canvas. Display-only: pulls in no encoder or glyph atlas/emoji-list code. A page that only shows strings imports imgoji/render.

    Index
    • Decode a codec (BFS quadtree) imgoji string onto a 2D context.

      Parameters

      • str: string

        imgoji codec string (optionally RLE-compressed): a background anchor followed by breadth-first cells, where each cell is either a plain glyph (with an optional leaf marker) or a DSL sprite list that claims the cell (positioned sprites; the quadtree subdivides beneath them). A leading glyph with no transform op is the background anchor (a solid color fill); give it a no-op op such as r0 to render it as a picture.

      • ctx: CanvasRenderingContext2D

        destination context.

      • Optionalsize: number = WORK

        canvas side length.

      • Optionalopts: { ox?: number; prefix?: number; scale?: number } = {}
        • Optionalox?: number

          / [opts.oy=0] origin offset within the canvas.

        • Optionalprefix?: number

          render only the first fraction of the stream (0..1; the prefix property). The decoder always emits at least the root glyph, so 0 shows level 0.

        • Optionalscale?: number

          output scale.

      Returns void