Repository: flutter
Issue: Italic text bounds seem to disagree with intrinsic text bounds with Text widget.
Labels: framework,a: typography,has reproducible steps,P2,team-engine,triaged-engine,found in release: 3.22,found in release: 3.23

### Steps to reproduce

1、add a Container ,set color red
2、add a Text in Contaniner
3、set the  fontStyle FontStyle.italic

### Expected results

Container  contain all the text.
and i want to know the italic text with include the out part.

### Actual results

part of text is out of container

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

void main() {
  debugPaintSizeEnabled = true;
  runApp(const MaterialApp(home: MyApp()));
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String text = 'Text';

  @override
  Widget build(BuildContext context) {
    const textStyleNormal = TextStyle(
      inherit: true,
      color: Color(0xff000000),
      fontSize: 378.0,
      height: 1.0,
      fontStyle: FontStyle.normal,
    );
    final textSpanNormal = TextSpan(text: text, style: textStyleNormal);
    final textPainterNormal = TextPainter(
      text: textSpanNormal,
      textDirection: TextDirection.ltr,
      maxLines: 1,
      textAlign: TextAlign.left,
    );
    textPainterNormal.layout(minWidth: 0, maxWidth: double.infinity);
    var computeLineMetrics = textPainterNormal.computeLineMetrics();
    for (var line in computeLineMetrics) {
      log("normal line $line");
    }

    const textStyleItalic = TextStyle(
      inherit: true,
      color: Color(0xff000000),
      fontSize: 378.0,
      height: 1.0,
      fontStyle: FontStyle.italic,
    );
    final textSpanItalic = TextSpan(text: text, style: textStyleItalic);
    final textPainterItalic = TextPainter(
      text: textSpanItalic,
      textDirection: TextDirection.ltr,
      maxLines: 1,
      textAlign: TextAlign.left,
    );
    textPainterItalic.layout(minWidth: 0, maxWidth: double.infinity);
    var computeLineMetricsItalic = textPainterItalic.computeLineMetrics();
    for (var line in computeLineMetricsItalic) {
      log("italic line $line");
    }
    return Scaffold(
      body: Column(
        children: [
          Container(
            color: Colors.red,
            child: Text(text,style: textStyleNormal,),
          ),
          Container(
            color: Colors.red,
            child: Text(text,style: textStyleItalic,),
          ),
        ],
      )
    );
  }
}

```

</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
 flutter doctor -v
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [版本 10.0.19045.4529], locale zh-CN)
    • Flutter version 3.22.1 on channel stable at E:\flutter\sdk\flutter3.22.1\flutter
    • Upstream repository https://github.com/flutter/flutter.git                      
    • Framework revision a14f74ff3a (7 weeks ago), 2024-05-22 11:08:21 -0500          
    • Engine revision 55eae6864b                                                      
    • Dart version 3.4.1                                                              
    • DevTools version 2.34.3                                                         
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Windows Version (Installed version of Windows is version 10 or higher)

[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[√] 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.10.0)
    • Visual Studio at D:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.10.34916.146
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2022.3)
    • Android Studio at D:\Program Files\Android\Android Studio20223121Giraffe
    • 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)

[√] Android Studio (version 2023.3)
    • Android Studio at D:\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 17.0.10+0--11572160)

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.19045.4529]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 126.0.6478.127
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 126.0.2592.87

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

```

</details>