brilliant-msg
    Preparing search index...

    Interface TextLayout

    Abstract interface for defining the geometry of a text layout area. This allows for different shapes like rectangles and circles.

    interface TextLayout {
        fontFamily?: string;
        fontSize: number;
        height: number;
        startY: number;
        textAlign: CanvasTextAlign;
        width: number;
        getLineLayout(
            lineY: number,
            lineHeight: number,
        ): null | { width: number; xOffset: number };
    }

    Implemented by

    Index

    Properties

    fontFamily?: string

    Optional font family name.

    fontSize: number

    The font size in pixels.

    height: number

    The height of the layout in pixels.

    startY: number

    The starting Y coordinate for laying out text.

    textAlign: CanvasTextAlign

    Text alignment within each line.

    width: number

    The width of the layout in pixels.

    Methods

    • Gets the layout parameters (width and x-offset) for a line at a specific Y position. Returns null if the line is outside the displayable area.

      Parameters

      • lineY: number
      • lineHeight: number

      Returns null | { width: number; xOffset: number }