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

Auto resize text by X-Scaling #110

Closed
ghost opened this issue Mar 23, 2022 · 0 comments
Closed

Auto resize text by X-Scaling #110

ghost opened this issue Mar 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Mar 23, 2022

Summary
auto_size_text automatically adjusts its content's text size so that it will fit in their given layout.
As an alternative option, I want to fix the content's X-scale and place it in the given layout so that I could show its full content without changing the text's height.

For describing my feature request, I created a sample app and capture that demonstrates the behavior of 3 text widgets.

auto-xscale-demo.mp4
  • The first TextWidget with red color represents Flutter's original text widgets with these parameters
Text(
  content,
  style:
      TextStyle(color: Colors.red, fontSize: fontSize),
  maxLines: 1,
  overflow: TextOverflow.ellipsis,
),
  • The second TextWidget with green color represents the auto_size_text with these parameters.
AutoSizeText(
  content,
  maxLines: 1,
  style: TextStyle(
      color: Colors.green, fontSize: fontSize),
),
  • The third text-widget with blue color represents the sample I am trying to add to this package.

Describe alternatives you've considered
This may sound improper in the UI/UX perspective (especially in western typography),
but I want this feature by transforming the text's X-scale because of these reasons.

  • In Japanese Fonts, fonts are assumed to be squashed if needed in order to fit in the given space. Those are designed in that way.
    • ref. Sorry, in Japanese only.
  • Preparing condensed fonts for every language is very costly.
  • Since the Flutter engine does not support text's width for now, I just want the alternative solution to fulfill our demand.

Version

  • Flutter version: 2.10.3
  • auto_size_text version: 3.0.0
@ghost ghost added the enhancement New feature or request label Mar 23, 2022
@ghost ghost closed this as completed Mar 23, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

0 participants