Skip to content

[WEB]Japanese punctuation and reading marks are misplaced. #165299

Closed

Description

@macoshita

Steps to reproduce

  1. Set up Flutter 3.29.
  2. Set a long sentence in the text widget.
  3. Display in Chrome.

Expected results

、 and 。 are just above the baseline as shown below.
The screenshots below show the results with Flutter 3.27.

Image

Actual results

、 and 。 are centered as follows

Image

Code sample

Code sample

https://dartpad.dev/?id=3382819292297fa111b8b16cec047abd

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: Text(
            '街の外れに位置する古びた図書館は、時代の流れから取り残されたように静かに佇んでいた。そこには古い本の匂いが漂い、訪れる人はまばらだった。だが、その図書館には誰も知らない秘密があった。\n'
            '\n'
            '毎晩、図書館が閉館すると、棚の奥にある古書がかすかに震え、表紙がゆっくりと開き始める。ページの間から淡い光が漏れ出し、その光に照らされて、小さな妖精たちが現れるのだった。彼らは本の中に宿る物語の守護者であり、物語が忘れられぬように毎晩語り合っていた。\n'
            '\n'
            'ある日、少年が偶然この秘密を見てしまった。彼は驚きのあまり声を失ったが、妖精たちは彼に優しく微笑みかけ、「君には僕らが見えるんだね」と話しかけた。その日から少年は毎晩図書館に通い、妖精たちから多くの物語を教わった。やがて少年は成長し、作家となり、図書館で聞いた物語を世界中に届けるようになった。',
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.3 24D60 darwin-arm64, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.98.2)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Activity

  1. maheshj01 commented on Mar 18, 2025

    @maheshj01
    Member

    Reproducible on stable and the master channel on the web (chrome and safari) with both renderers skwasm and canvaskit

    macOS (Expected)

    Image

    Web (Actual)

    Image
    flutter doctor -v
    [✓] Flutter (Channel master, 3.31.0-1.0.pre.18, on macOS 15.1.1 24B2091 darwin-arm64, locale en-US) [2.2s]
        • Flutter version 3.31.0-1.0.pre.18 on channel master at /Users/mahesh/Development/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 25e5ffd8c2 (6 days ago), 2025-03-11 19:27:32 -0400
        • Engine revision 25e5ffd8c2
        • Dart version 3.8.0 (build 3.8.0-171.0.dev)
        • DevTools version 2.44.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.2s]
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-35, build-tools 35.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 16.0) [1,508ms]
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 16A242d
        • CocoaPods version 1.16.2
    
    [✓] Chrome - develop for the web [139ms]
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2024.3) [139ms]
        • Android Studio at /Applications/Android Studio.app/Contents
        • 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.5+-12932927-b750.29)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1) [137ms]
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.96.2) [18ms]
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.102.0
    
    [✓] Connected device (3 available) [7.1s]
        • iPhone 16 Pro (mobile) • 34497AEA-B6B0-4F79-99A3-6E40007745A3 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-0
          (simulator)
        • macOS (desktop)        • macos                                • darwin-arm64   • macOS 15.1.1 24B2091 darwin-arm64
        • Chrome (web)           • chrome                               • web-javascript • Google Chrome 131.0.6778.265
    
    [✓] Network resources [393ms]
        • All expected network resources are available.
    
    • No issues found!
    
    [!] Flutter (Channel stable, 3.29.2, on macOS 15.1.1 24B2091 darwin-arm64, locale en-US) [609ms]
        • Flutter version 3.29.2 on channel stable at /Users/mahesh/Development/flutter
        ! Warning: `flutter` on your path resolves to /Users/mahesh/Development/flutter_master/bin/flutter, which is not inside your current
          Flutter SDK checkout at /Users/mahesh/Development/flutter. Consider adding /Users/mahesh/Development/flutter/bin to the front of
          your path.
        ! Warning: `dart` on your path resolves to /Users/mahesh/Development/flutter_master/bin/dart, which is not inside your current
          Flutter SDK checkout at /Users/mahesh/Development/flutter. Consider adding /Users/mahesh/Development/flutter/bin to the front of
          your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision c236373904 (4 days ago), 2025-03-13 16:17:06 -0400
        • Engine revision 18b71d647a
        • Dart version 3.7.2
        • DevTools version 2.42.3
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update
          checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.1s]
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-35, build-tools 35.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 16.0) [1,398ms]
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 16A242d
        • CocoaPods version 1.16.2
    
    [✓] Chrome - develop for the web [137ms]
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2024.3) [136ms]
        • Android Studio at /Applications/Android Studio.app/Contents
        • 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.5+-12932927-b750.29)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1) [135ms]
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.96.2) [18ms]
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.102.0
    
    [✓] Connected device (4 available) [6.6s]
        • iPhone 16 Pro (mobile)          • 34497AEA-B6B0-4F79-99A3-6E40007745A3 • ios            •
          com.apple.CoreSimulator.SimRuntime.iOS-18-0 (simulator)
        • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 15.1.1 24B2091 darwin-arm64
        • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 15.1.1 24B2091 darwin-arm64
        • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 131.0.6778.265
    
    [✓] Network resources [274ms]
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
    
  2. added
    engineflutter/engine related. See also e: labels.
    a: internationalizationSupporting other languages or locales. (aka i18n)
    a: typographyText rendering, possibly libtxt
    platform-webWeb applications specifically
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Mar 18, 2025
  3. changed the title [-][WEB][CanvasKit]Japanese punctuation and reading marks are misplaced.[/-] [+][WEB]Japanese punctuation and reading marks are misplaced.[/+] on Mar 18, 2025
  4. yjbanov commented on Mar 18, 2025

    @yjbanov
    Contributor

    I see the bug in dartpad.

    (@maheshj01, FYI, your repro seems to use the same macOS screenshot both for macOS and web)

  5. added
    e: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Web
    e: web_skwasmSkwasm rendering backend for web
    on Mar 18, 2025
  6. 5 remaining items

  7. flutter-triage-bot commented on Mar 18, 2025

    @flutter-triage-bot

    Issue is assigned to multiple teams (engine, web). Please ensure the issue has only one team-* label at a time. Use fyi-* labels to have another team look at the issue without reassigning it.

  8. maheshj01 commented on Mar 18, 2025

    @maheshj01
    Member

    Updated.

  9. macoshita commented on Mar 19, 2025

    @macoshita
    Author

    When specifying Noto Sans JP in Google Fonts, this issue does not occur.
    Since Noto Sans JP has a very large file size, as a workaround, I incorporated a subset of Noto Sans JP that includes only 、 and 。 into the project and applied the font, but even in that case, the issue did not occur.
    I hope this information is helpful.

  10. koji-1009 commented on Mar 29, 2025

    @koji-1009
    Contributor

    Text display corruption occurs when the string "表紙がゆっくりと開き始める。ページの間から淡い光が漏れ出" is reproduced.
    This issue is not limited to this specific text area and also affects other UI elements. For example, if the problematic text is added to the body and an AppBar contains a title (e.g., "テスト。"), the AppBar's title also exhibits the same display corruption.

  11. added a commit that references this issue on Jun 9, 2025
  12. github-actions commented on Jun 19, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)a: qualityA truly polished experiencea: typographyText rendering, possibly libtxtdependency: skiaSkia team may need to help use: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webe: web_skwasmSkwasm rendering backend for webengineflutter/engine related. See also e: labels.found in release: 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions