anchor.diff:  /// [_canvasContext].
   double _measureSubstring(
     html.CanvasRenderingContext2D _canvasContext,
  -  ParagraphGeometricStyle style,
     String text,
     int start,
  -  int end,
  -) {
  +  int end, {
  +  double? letterSpacing,
  +}) {
     assert(0 <= start);
     assert(start <= end);
     assert(end <= text.length);
  
positive.code: int _lastStart = -1;
  int _lastEnd = -1;
  String _lastText = '';
  ParagraphGeometricStyle? _lastStyle;
  double _lastWidth = -1;
  
  /// Measures the width of the substring of [text] starting from the index
  
negative.code:     return 0;
    }
  
    final String cssFont = _canvasContext.font;
    double width;
  
    // TODO(mdebbar): Explore caching all widths in a map, not only the last one.
    if (start == _lastStart &&
        end == _lastEnd &&
        text == _lastText &&
        cssFont == _lastCssFont) {
      // Reuse the previously calculated width if all factors that affect width
      // are unchanged. The only exception is letter-spacing. We always add
      // letter-spacing to the width later below.
      width = _lastWidth;
    } else {
      final String sub =
        start == 0 && end == text.length ? text : text.substring(start, end);
      width = _canvasContext.measureText(sub).width!.toDouble();
    }
  
    _lastStart = start;
    _lastEnd = end;
    _lastText = text;
    _lastCssFont = cssFont;
    _lastWidth = width;
  
    // Now add letter spacing to the width.
    letterSpacing ??= 0.0;
    if (letterSpacing != 0.0) {
      width += letterSpacing * (end - start);
    }
  
    // What we are doing here is we are rounding to the nearest 2nd decimal
    // point. So 39.999423 becomes 40, and 11.243982 becomes 11.24.
    // The reason we are doing this is because we noticed that canvas API has a
    // ±0.001 error margin.
    return _roundWidth(width);
  }
  
  double _roundWidth(double width) {
  