VSTF.TextBounds?TryGetNormalizedTextBounds(VST.Span lineSpan)
        {
            if (!IsValid)
            {
                throw new ObjectDisposedException(nameof(HexFormattedLineImpl));
            }
            var span = lineExtent.Intersection(lineSpan);

            if (span is null)
            {
                return(null);
            }

            var startBounds = GetFirstTextBounds(span.Value.Start);
            var endBounds   = GetLastTextBounds(span.Value.End);

            if (span.Value.End > TextSpan.End)
            {
                endBounds = new VSTF.TextBounds(
                    endBounds.Trailing + EndOfLineWidth,
                    endBounds.Top,
                    0,
                    endBounds.Height,
                    endBounds.TextTop,
                    endBounds.TextHeight);
            }

            return(new VSTF.TextBounds(startBounds.Left, startBounds.Top, endBounds.Left - startBounds.Left, startBounds.Height, startBounds.TextTop, startBounds.TextHeight));
        }