Repository: flutter
Issue: Render issues when displaying borderer/outlined text
Labels: engine,a: typography,c: rendering,has reproducible steps,P2,team-engine,triaged-engine,found in release: 3.27,found in release: 3.28

### Steps to reproduce

Using TextStyle with higher strokeWidth values in foreground Paint. Here is the docs link with a sample https://api.flutter.dev/flutter/painting/TextStyle-class.html#painting.TextStyle.6

My code expands on it a bit to test for all uppercase chars and sets Roboto font for consistency across platforms. It also increases the strokeWidth to create this "spike render" bugs. On some fonts its more noticeable than other. It mostly affects A M N and V chars.

1. Create a new flutter project
2. Add Google fonts package to get the same font on iOS and Android https://pub.dev/packages/google_fonts
3. Run the sample code on Android and/or iOS physical device or simulator/emulator. The result is always the same.

### Expected results

Should render letters without spikes. Here is an edited image of expected results.

<img src="https://github.com/user-attachments/assets/60757c09-94d7-492c-aace-30870448d8a8" width ="300">  

### Actual results

Renders spikes on A, M, N and V letters. The screenshots are form an Android Pixel 8 and from iPhone 16 simulator.
Pixel 8 | Simulator Iphone 16
:-------------------------:|:-------------------------:
![Pixel 8](https://github.com/user-attachments/assets/ce061a8b-438c-4363-9a82-0f90fc810dbe) | ![Simulator iPhone 16](https://github.com/user-attachments/assets/d8547fa6-98e1-46b3-8fe2-6a162b1bee49)


### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    String sampleText = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    return MaterialApp(
      title: 'Outline Text',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        body: Center(
            child: Stack(
          children: <Widget>[
            // Stroked text as border.
            Text(
              sampleText,
              style: GoogleFonts.roboto(
                fontSize: 40,
                foreground: Paint()
                  ..style = PaintingStyle.stroke
                  ..strokeWidth = 10
                  ..color = Colors.blue[700]!,
              ),
            ),
            // Solid text as fill.
            Text(
              sampleText,
              style: GoogleFonts.roboto(
                fontSize: 40,
                color: Colors.grey[300],
              ),
            ),
          ],
        )),
      ),
    );
  }
}

```

</details>


### 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

<details open><summary>Doctor output</summary>

```console
PS C:\Users\Rok\FlutterProjects\Test\outlinetext> flutter doctor -v               
[√] Flutter (Channel stable, 3.27.1, on Microsoft Windows [Version 10.0.22631.4602], locale en-SI)
    • Flutter version 3.27.1 on channel stable at C:\Users\Rok\Flutter SDK\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 17025dd882 (4 weeks ago), 2024-12-17 03:23:09 +0900
    • Engine revision cb4b5fff73
    • Dart version 3.6.0
    • DevTools version 2.40.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc2)
    • Android SDK at C:\Users\Rok\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.0-rc2
    • Java binary at: C:\Users\Rok\JDK\jdk-17.0.13+11\bin\java
    • Java version OpenJDK Runtime Environment Temurin-17.0.13+11 (build 17.0.13+11)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2024.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)

[√] VS Code (version 1.95.2)
    • VS Code at C:\Users\Rok\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.100.0

[√] Connected device (4 available)
    • Pixel 8 (mobile)  • 37261FDJH00C99 • android-arm64  • Android 14 (API 34)
    • Windows (desktop) • windows        • windows-x64    • Microsoft Windows [Version 10.0.22631.4602]
    • Chrome (web)      • chrome         • web-javascript • Google Chrome 131.0.6778.265
    • Edge (web)        • edge           • web-javascript • Microsoft Edge 125.0.2535.85

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

```

</details>