Svelte API
GlyphOverlay, the highlight action, the glyphline attachment, domText and asyncText.
import { asyncText, domText, GlyphOverlay, glyphline, highlight } from "glyphline/svelte";<GlyphOverlay>
Renders the <svg> overlay. Put it inside a positioned element that wraps the text. Other attributes are passed to the svg.
Prop
Type
use:highlight={params}
Action for an <svg> you render yourself. params are the props above (source, sentence, word, marks, selection, options). Works in Svelte 4 and 5.
{@attach glyphline(params)}
The same as a Svelte 5 attachment.
domText(options?)
{ source, attach }: put {@attach text.attach} on the element; text.source is reactive and rebuilt when the element's text changes. options are those of domSource.
asyncText(make)
{ source }, resolved from make() in an effect: it reruns when anything make reads changes and drops results that arrive after a newer run. Return null for "nothing yet". Call it during component setup.
const text = asyncText(() => page && pdfSource(page, { OPS }));Everything else (sources, wordAtPoint, shapes, motion) comes from the core: see API.
Made by Lucas Piera