Versions in this module Expand all Collapse all v0 v0.2.0-alpha Sep 27, 2026 v0.1.0 Sep 27, 2026 Changes in this version + func AppendBoundsOfTextRange(dst []image.Rectangle, p *TextLayoutParams, start, end int) []image.Rectangle + func CachedVisualLineCount(width int, logicalLine string, wrapMode WrapMode, face font.Face, ...) int + func CachedVisualLineMaxCaretX(width int, logicalLine string, wrapMode WrapMode, face font.Face, ...) float64 + func Draw(bounds image.Rectangle, dst *ebiten.Image, str string, options *DrawOptions) + func FindWordBoundaries(text string, idx int) (start, end int) + func FirstLineBreakPositionAndLen(str string) (pos, length int) + func LastLineBreakPositionAndLen(str string) (pos, length int) + func Measure(width int, str string, wrapMode WrapMode, face font.Face, faceRuns []FaceRun, ...) (float64, float64) + func MeasureHeight(width int, str string, wrapMode WrapMode, face font.Face, faceRuns []FaceRun, ...) float64 + func MeasureLogicalLine(width int, logicalLine string, wrapMode WrapMode, face font.Face, ...) (float64, float64) + func MeasureLogicalLineHeight(width int, logicalLine string, wrapMode WrapMode, face font.Face, ...) float64 + func NextPositionOnGraphemes(str string, position int) int + func PrevPositionOnGraphemes(str string, position int) int + func TextIndexFromPosition(p *TextLayoutParams, position image.Point) int + func TextIndexFromPositionInLogicalLine(width int, position image.Point, logicalLine string, ...) int + func TrimPartialUTF8Prefix(s string) string + func TrimPartialUTF8Suffix(s string) string + func VisualLineCountForLogicalLine(width int, logicalLine string, wrapMode WrapMode, face font.Face, ...) int + type CompositionInfo struct + LineIndex int + RenderingByteShift int + RenderingYShift int + func ComputeCompositionInfo(p *CompositionInfoParams) (CompositionInfo, bool) + type CompositionInfoParams struct + CommittedFaceRuns []FaceRun + CommittedSelectionLine string + CompositionText string + Face font.Face + KeepTailingSpace bool + LineByteOffsets *LineByteOffsets + LineHeight float64 + LineHeightMode LineHeightMode + RenderingFaceRuns []FaceRun + RenderingSelectionLine string + SelectionEnd int + SelectionLineStartInBytes int + SelectionStart int + TabWidth float64 + WrapMode WrapMode + WrapWidth int + type DrawOptions struct + ActiveCompositionColor color.Color + CompositionActiveEnd int + CompositionActiveStart int + CompositionBorderWidth float32 + CompositionEnd int + CompositionStart int + DrawComposition bool + DrawSelection bool + InactiveCompositionColor color.Color + LayoutWidth int + SelectionColor color.Color + SelectionEnd int + SelectionStart int + StyleRuns []StyleRun + TextColor color.Color + VisibleBounds image.Rectangle + type FaceRun struct + End int + Face font.Face + Start int + type HorizontalAlign int + const HorizontalAlignCenter + const HorizontalAlignEnd + const HorizontalAlignLeft + const HorizontalAlignRight + const HorizontalAlignStart + type Insertion struct + Face font.Face + IndexInBytes int + type LineByteOffsets struct + func (l *LineByteOffsets) ByteOffsetByLineIndex(i int) int + func (l *LineByteOffsets) LineCount() int + func (l *LineByteOffsets) LineIndexForByteOffset(byteOffset int) int + func (l *LineByteOffsets) Rebuild(scan func(io.Writer) error) error + func (l *LineByteOffsets) Replace(newText string, start, end int, startCtx, endCtx string, atEOT bool) + func (l *LineByteOffsets) Reset() + type LineHeightMode int + const LineHeightModeFixed + const LineHeightModeFlexible + type Style struct + EllipsisString string + Face font.Face + FaceRuns []FaceRun + HorizontalAlign HorizontalAlign + Insertion Insertion + KeepTailingSpace bool + LineHeight float64 + LineHeightMode LineHeightMode + TabWidth float64 + VerticalAlign VerticalAlign + WrapMode WrapMode + type StyleRun struct + BackgroundColor color.Color + Color color.Color + End int + Start int + Strikethrough bool + Underline bool + type TextLayoutParams struct + CommittedFaceRuns []FaceRun + CommittedTextRange func(start, end int) string + CompositionLen int + LogicalLineIndexHint int + PrecomputedLineByteOffsets *LineByteOffsets + RenderingTextLength int + RenderingTextRange func(start, end int) string + SelectionEnd int + SelectionStart int + Style Style + VisualLineIndexHint int + Width int + type TextPosition struct + Bottom float64 + Top float64 + X float64 + func PositionWithinLogicalLine(p *TextLayoutParams, index int) (lineIdx int, position0, position1 TextPosition, count int) + func TextPositionFromIndex(p *TextLayoutParams, index int) (position0, position1 TextPosition, count int) + func TextPositionFromIndexInLogicalLine(width int, logicalLine string, logicalLineStartInBytes, index int, ...) (position0, position1 TextPosition, count int) + type VerticalAlign int + const VerticalAlignBottom + const VerticalAlignMiddle + const VerticalAlignTop + type VisibleRange struct + EndInBytes int + FirstLine int + LastLine int + StartInBytes int + YShift int + func VisibleRangeInViewport(p *VisibleRangeInViewportParams) (VisibleRange, bool) + type VisibleRangeInViewportParams struct + Composition CompositionInfo + Face font.Face + FaceRuns []FaceRun + FirstLogicalLineInViewport int + Insertion Insertion + KeepTailingSpace bool + LineByteOffsets *LineByteOffsets + LineHeight float64 + LineHeightMode LineHeightMode + RenderingTextLength int + RenderingTextRange func(start, end int) string + TabWidth float64 + ViewportSize image.Point + WrapMode WrapMode + type WrapMode int + const WrapModeAnywhere + const WrapModeNone + const WrapModeNormal