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

Text is outside its background #13

Closed
arnirichard opened this issue Aug 15, 2022 · 2 comments
Closed

Text is outside its background #13

arnirichard opened this issue Aug 15, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@arnirichard
Copy link

arnirichard commented Aug 15, 2022

Describe the bug
When using Thai characters, sometimes the text appears partly outside its background.
Tested both on Android and web

Is there any workaround?

To Reproduce
Steps to reproduce the behavior:

  1. Add text
    RoundedBackgroundText('ที่', style: TextStyle(fontFamily: 'Sarabun', fontSize: 26), backgroundColor: Colors.amber)
  2. Add font (fonts folder is attached)
    pubspec..yaml:
    ` fonts:
    • family: Sarabun
      fonts:
      • asset: fonts/Sarabun-Regular.ttf`

Expected behavior
Text should appear inside its background

Screenshots
image

Additional context
Fonts folder:
https://www.arnirichard.dk/fonts.zip

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 3.1.0-0.0.pre.2268, on Microsoft Windows [Version 10.0.22000.856], locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
[√] Android Studio (version 2021.2)
[√] Connected device (4 available)
[√] HTTP Host Availability

• No issues found!

@bdlukaa bdlukaa added the bug Something isn't working label Aug 15, 2022
@bdlukaa
Copy link
Owner

bdlukaa commented Oct 1, 2022

The same happens with Korean, Japanese, Chinese, Hebrew and Arabic alphabets. It seems flutter fails to correctly calculate the height of the line for those alphabets.

Related:

By reading some threads, it may be related to the specific font used

@bdlukaa
Copy link
Owner

bdlukaa commented Jul 16, 2023

This issue seems to have been fixed by the flutter team:

thai:
thai

korean:
korean

japanese:
japanese

@bdlukaa bdlukaa closed this as completed Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants