Repository: flutter
Issue: Zero-width character (\u200b) does not have zero-width
Labels: framework,dependency: skia,has reproducible steps,P3,team-engine,triaged-engine,found in release: 3.27,found in release: 3.28

### Steps to reproduce

1. Copy-paste the code sample in DartPad
2. Run it with the `useScaffold` flag set to true
3. Run it with the `useScaffold` flag set to false
4. Compare results 

### Expected results

I expect the zero-width characters in the string to have zero width, even when many such characters are placed in sequence.

### Actual results

When the text is placed in a Scaffold, the zero-width characters take up a lot of space when multiple are combined in sequence. See the attached screenshots. It does not happen if there is not a Material parent, and it does not seem to be an issue with the default Roboto font either. I presume it is an issue with the rendering engine.

I am creating these strings because I'm extending `TextEditingController`, where the stored `text` is different from what I want to display, and what I want to display is typically shorter than what I have stored, so I pad it with these zero-width characters to make the displayed text have the same length as the stored text for the sake of correcting cursor issues (the cursor shows weird behaviour when trying to navigate through text that has a different amount of characters compared to the controller's text).

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});
  
  final String zeroWidthCharacter = '\u200b'; 
  final useScaffold = false;

  @override
  Widget build(BuildContext context) {
    final body = Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text('One${zeroWidthCharacter * 100}Two'),
            Text('One${zeroWidthCharacter * 10}Two'),
            Text('One${zeroWidthCharacter * 1}Two'),
            Text('OneTwo'),
          ],
        )
      );
  return useScaffold
     ? Scaffold(body: body)
     : body;
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

<p>
  <img src="https://github.com/user-attachments/assets/ad9d2c05-72a9-44c0-bb58-6fe34d918474"
    alt="Behaviour of zero-width characters with a Material parent" height="240"/>
  &nbsp;&nbsp;&nbsp;&nbsp;
  <img src="https://github.com/user-attachments/assets/983a9dd5-16a4-4e20-b569-d6e3b86f5ba8"
   alt="Behaviour of zero-width characters without a Material parent" height="240"/>
</p>

</details>


### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.22.3, on Microsoft Windows [Version 10.0.22631.4460], locale en-GB)
    • Flutter version 3.22.3 on channel stable at C:\Users\wesse\fvm\versions\3.22.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b0850beeb2 (5 months ago), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\wesse\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\wesse\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.1)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34316.72
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2022.3)
    • 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 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.96.0-insider)
    • VS Code at C:\Users\wesse\AppData\Local\Programs\Microsoft VS Code Insiders
    • Flutter extension version 3.102.0

[√] Connected device (4 available)
    • SM A715F (mobile) • R58N51AWRTP • android-arm64  • Android 13 (API 33)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.22631.4460]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 127.0.6533.74
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 131.0.2903.86

[√] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>