Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] web 中会自动下载两个其他的字体文件 #158

Open
jiajiawei opened this issue Jan 3, 2024 · 8 comments
Open

[Bug report] web 中会自动下载两个其他的字体文件 #158

jiajiawei opened this issue Jan 3, 2024 · 8 comments

Comments

@jiajiawei
Copy link

Version

12.0.0(以前的也有)

Platforms

Web

Device Model

chrome

flutter info

[✓] Flutter (Channel stable, 3.16.5, on Microsoft Windows [版本 10.0.22621.2861], locale zh-CN)
    • Flutter version 3.16.5 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (2 weeks ago), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4
    • Pub download mirror https://pub.flutter-io.cn

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at C:\Users\Administrator\AppData\Local\Android\sdk
    • Platform android-34, build-tools 32.1.0-rc1
    • 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 Enterprise 2019 16.11.26)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
    • Visual Studio Enterprise 2019 version 16.11.33529.622
    • Windows 10 SDK version 10.0.20348.0

[✓] Android Studio (version 2022.3)
    • 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 17.0.6+0-b2043.56-10027231)

[✓] VS Code, 64-bit edition (version 1.82.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.80.0

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.22621.2861]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 120.0.6099.111
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 118.0.2088.46

[!] Network resources
    ✗ A network error occurred while checking "https://maven.google.com/": 信号灯超时时间已到

How to reproduce?

joinZeroWidthSpace: true时, 已经使用了"Microsoft YaHei"字体. 还会自动下载两个其他字体文件
pubspec.yaml

  assets:
    - msyh.ttf
  
  fonts:
  - family: Microsoft YaHei
    fonts:
      - asset: msyh.ttf
const ExtendedText(
  '汉字',
  style: TextStyle(fontFamily: 'Microsoft YaHei'),
  joinZeroWidthSpace: true,
)

image

https://fonts.gstatic.com/s/notosanssc/v36/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG9_FnYxNbPzS5HE.ttf
https://fonts.gstatic.com/s/notosans/v30/o-0IIpQlx3QUlC5A4PNb4j5Ba_2c7A.ttf

Logs

No response

Example code (optional)

No response

Contact

No response

@zmtzawqlp
Copy link
Member

zmtzawqlp commented Jan 3, 2024

没懂你的意思,下不下载不是库说了算。引擎里面需要这个字体,就会下载

@jiajiawei
Copy link
Author

对, 下不下载是引擎自动的, 需要那个字体了就会自动下载.

但是现在的情况是我指定了TextStyle(fontFamily: 'Microsoft YaHei'), 就不该需要其他字体了.

我尝试修改了 output = SpecialTextSpan (extended_text_utils line598)

->

output = TextSpan(
         text: text ?? '',
         children: children,
         style: value.style,
         recognizer: value.recognizer,
         semanticsLabel: value.semanticsLabel,
       );

就不会自动下载那两个字体文件了.

没看出来SpecialTextSpan 和系统级的TextSpan的差异点在哪里.....

@jiajiawei
Copy link
Author

@zmtzawqlp 这个并没有解决呢, 为什么关闭...

@zmtzawqlp zmtzawqlp reopened this Jan 5, 2024
@zmtzawqlp
Copy link
Member

@zmtzawqlp 这个并没有解决呢, 为什么关闭...

这个东西,应该并不是组件的问题

@zmtzawqlp
Copy link
Member

joinZeroWidthSpace: true 这个实际上是给字符串插入了空占位符,你可以试试用官方的Text能重现不,如果能,可以给官方开一个issue问问

@jiajiawei
Copy link
Author

是的, 能复现. 谢谢

@zmtzawqlp
Copy link
Member

是的, 能复现. 谢谢

开了issue,记得发下,我也跟踪一下。谢谢

@jiajiawei
Copy link
Author

flutter/flutter#143728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants