Skip to content

textScaleFactor not working on web when text scale change in Browser/System Level #52061

@tsinis

Description

@tsinis

Hey Flutter Team!

There is problem with textScaleFactor in web builds inside Chrome (desktop versions, i have tested on Windows 10). It's just ignored in fact. For example, if user have text scaling in Windows set to 125% i can do nothing about it in my web site made with Flutter, because textScaleFactor parameters (set to 1.0 in Text()) is overrides by those system settings. So fonts become messy... Same code hover working properly on Android platform (as an APK).

I believe there should be labels: "a: typography", "☸ platform-web" .

Steps to Reproduce

  1. Run flutter create textscalefactor.
  2. Swap lib/main.dart with main.dart file from attachment
    textScalFactor.zip
  3. Change Scale and layout in Settings (Display Settings) to anything bigger then 100%
  4. Run cd textscalefactor
  5. Run
    flutter run -d chrome --release --dart-define=FLUTTER_WEB_USE_EXPERIMENTAL_CANVAS_TEXT=true or just flutter run -d chrome

Expected results:
Fonts should have sizes defined in TextStyle's fontSize parameter. Please see screenshots in attachment ZIP file.

Actual results:
Fonts have sizes multiplied by % from system's font scale settings. Please see screenshots in attachment ZIP file.

Logs
PS C:\Users\tsinis\Documents\GitHub\textscalefactor> flutter run -d chrome  --verbose
[  +39 ms] executing: [C:\Android\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +79 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] 3018d8ddb3b40156b6d5a32ee4deaaa80277ea71
[   +1 ms] executing: [C:\Android\flutter/] git describe --match v*.*.* --first-parent --long --tags
[  +62 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[   +1 ms] v1.15.10-0-g3018d8ddb
[  +10 ms] executing: [C:\Android\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +50 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[   +1 ms] origin/dev
[        ] executing: [C:\Android\flutter/] git ls-remote --get-url origin
[ +100 ms] Exit code 0 from: git ls-remote --get-url origin
[   +3 ms] https://github.com/flutter/flutter.git
[ +132 ms] executing: [C:\Android\flutter/] git rev-parse --abbrev-ref HEAD
[  +48 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +1 ms] dev
[  +77 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +64 ms] executing: C:\Android\platform-tools\adb.exe devices -l
[  +27 ms] Exit code 0 from: C:\Android\platform-tools\adb.exe devices -l
[   +1 ms] List of devices attached
[  +15 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +359 ms] Generating C:\Users\tsinis\Documents\GitHub\textscalefactor\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +193 ms] Launching lib\main.dart on Chrome in debug mode...
[ +171 ms] Serving DevTools at http://127.0.0.1:50227

[  +12 ms] Updating assets
[ +149 ms] Syncing files to device Chrome...
[  +84 ms] Generating C:\Users\tsinis\Documents\GitHub\textscalefactor\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +49 ms] <- reset
[  +14 ms] C:\Android\flutter\bin\cache\dart-sdk\bin\dart.exe C:\Android\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\Android\flutter\bin\cache\flutter_web_sdk/ --incremental --target=dartdevc -Ddart.developer.causal_async_stacks=true --output-dill
C:\Users\tsinis\AppData\Local\Temp\flutter_tool.5beaafe9-5f32-11ea-b922-2818783214f0\app.dill --libraries-spec
file:///C:/Android/flutter/bin/cache/flutter_web_sdk/libraries.json --packages C:\Users\tsinis\Documents\GitHub\textscalefactor\.packages -Ddart.vm.profile=false
-Ddart.vm.product=false --bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions
--enable-asserts --track-widget-creation --filesystem-root C:\Users\tsinis\AppData\Local\Temp\flutter_tools.5beaafea-5f32-11ea-b922-2818783214f0 --filesystem-scheme
org-dartlang-app --platform file:///C:/Android/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk.dill
[  +20 ms] <- compile org-dartlang-app:///web_entrypoint.dart
[+21322 ms] Syncing files to device Chrome... (completed in 21,478ms, longer than expected)
[   +2 ms] Synced 20.6MB.
[        ] <- accept
[ +271 ms] [CHROME]:
[  +28 ms] [CHROME]:DevTools listening on ws://127.0.0.1:50249/devtools/browser/b7b9be9a-8a2f-44f4-a33e-a4ebd7fd1464
[+6711 ms] Debug service listening on ws://127.0.0.1:50286/sLCDppapvyI=

[ +561 ms] Debug service listening on ws://127.0.0.1:50286/sLCDppapvyI=
[   +3 ms] Warning: Flutter's support for web development is not stable yet and hasn't
[        ] been thoroughly tested in production environments.
[        ] For more information see https://flutter.dev/web
[   +1 ms]   To hot restart changes while running, press "r". To hot restart (and refresh the browser), press "R".
[   +1 ms] For a more detailed help message, press "h". To quit, press "q".
PS C:\Users\tsinis\Documents\GitHub\textscalefactor> flutter analyze 
Analyzing textscalefactor...                                            
No issues found! (ran in 4.6s)
PS C:\Users\tsinis\Documents\GitHub\textscalefactor> flutter doctor -v
[√] Flutter (Channel dev, v1.15.10, on Microsoft Windows [Version 10.0.17763.1075], locale en-US)
    • Flutter version 1.15.10 at C:\Android\flutter
    • Framework revision 3018d8ddb3 (18 hours ago), 2020-03-04 20:46:01 -0800
    • Engine revision 7df0a6e35e
    • Dart version 2.8.0 (build 2.8.0-dev.11.0 8e5354dccb)

 
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Android\
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = C:\Android
    • ANDROID_SDK_ROOT = C:\Android\tools
    • Java binary at: C:\Android\openjdk\bin\java
    • Java version OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • CHROME_EXECUTABLE = C:\Users\tsinis\AppData\Local\Google\Chrome SxS\Application\chrome.exe

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/setup/#android-setup for detailed instructions).

[√] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • unknown
    • Web Server • web-server • web-javascript • Flutter Tools

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: typographyText rendering, possibly libtxtengineflutter/engine related. See also e: labels.found in release: 1.24Found to occur in 1.24has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions