mwg API
    Preparing search index...

    Type Alias MarkupMeasure

    MarkupMeasure: (
        piece: Pick<
            MarkupSpan,
            "text"
            | "bold"
            | "italic"
            | "size"
            | "image"
            | "tag",
        >,
    ) => number

    Measures one atomic layout piece - a word, a single space, or an image span - under whatever style it carries. A canvas backend measures with TextMetrics; a fixed-width test double can measure with a plain character count. piece.image is set instead of piece.text for an image span, so a measurer can give it the icon's own width rather than treating it as zero-width text.

    Type Declaration

      • (
            piece: Pick<
                MarkupSpan,
                "text"
                | "bold"
                | "italic"
                | "size"
                | "image"
                | "tag",
            >,
        ): number
      • Parameters

        • piece: Pick<MarkupSpan, "text" | "bold" | "italic" | "size" | "image" | "tag">

        Returns number