Repository: flutter
Issue: Text Rendering Issue on Canvas After Flutter Update
Labels: waiting for customer response,in triage

### Steps to reproduce

Dear Flutter Team,

I hope this message finds you well. After updating Flutter to the latest version, I've encountered an issue with text rendering on the canvas in my application. Previously, I used the canvas to display points and lines, with point names rendered as text. However, post-update, when zooming in, the point names appear very faint and are difficult to read; with further zooming, they disappear entirely. but in higher zoom levels there isn't a problem. This problem arose solely after updating Flutter, without any changes to my existing code.


I would appreciate any guidance or solutions you can provide to resolve this issue in the next update.

<img src="https://github.com/user-attachments/assets/a1c2dea6-15b8-44f8-ab9f-d055627244be" width="300" />
<img src="https://github.com/user-attachments/assets/77bddebc-3c32-4f0a-a22d-0b0a22cf3700" width="300" />
<img src="https://github.com/user-attachments/assets/d17f44a7-d9a5-445f-9907-1752a9e5f2c4" width="300" />



### Expected results

<img src="https://github.com/user-attachments/assets/92a2017b-350c-4480-9c4e-a45eb929f8e4" width="300" />

### Actual results

<img src="https://github.com/user-attachments/assets/38a8b0a5-4578-4a55-94db-ce4832cef0ea" width="300" />
<img src="https://github.com/user-attachments/assets/48865dc5-0c6e-45b6-b7be-e8e7991f1848" width="300" />

### Code sample


```dart
@override
  void paint(Canvas canvas, Size size) {
    canvas.translate(translateX, translateY);
    canvas.scale(paintScale);

    final ciPaint = Paint()
      ..color = Colors.black
      ..strokeWidth = 1 / paintScale
      ..style = PaintingStyle.stroke;
    final pointPaint = Paint()
      ..strokeWidth = 0.5 / paintScale
      ..strokeCap = StrokeCap.square;
.
.
.

for (int i = 0; i < points.length; i++) {
      if (layersKeys.contains(points[i].layer)) {
        if (layers[layersKeys.indexOf(points[i].layer)].visibility) {
          pointPaint.color = points[i].selected
              ? Colors.red
              : points[i].key == 'device_name_loc_point'
                  ? orangeColor
                  : Color(
                      layers[layersKeys.indexOf(points[i].layer)].colorValue);
          canvas.drawCircle(
              Offset(points[i].dX, points[i].dY), 5 / paintScale, pointPaint);

          TextSpan span = TextSpan(
            text: points[i].name!,
            style: TextStyle(
              color: points[i].key == 'device_name_loc_point'
                  ? orangeColor
                  : points[i].selected
                      ? Colors.red
                      : Color(layers[layersKeys.indexOf(points[i].layer)]
                          .colorValue),
              fontSize: 0.2 * cadScale,
            ),
          );
          TextPainter tp = TextPainter(
            text: span,
            textAlign: TextAlign.left,
            textDirection: TextDirection.ltr,
          );
          tp.layout();

          double textX = points[i].dX;
          double textY = points[i].dY;
          canvas.save();
          canvas.translate(textX, textY);
          tp.paint(canvas, Offset(0.01, 0.01));
          canvas.restore();
        }
      }
    }
```

### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.27.2, on Microsoft Windows [Version 10.0.19045.5371], locale fa-IR)
[√] Windows Version (Installed version of Windows is version 10 or higher)                        
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Enterprise 2022 17.7.5)
[√] Android Studio (version 2024.2)
[√] Connected device (4 available)
[√] Network resources