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

TeXView on some devices, does not display anything. #196

Open
IrfanKnowledge opened this issue Oct 17, 2024 · 2 comments
Open

TeXView on some devices, does not display anything. #196

IrfanKnowledge opened this issue Oct 17, 2024 · 2 comments

Comments

@IrfanKnowledge
Copy link

flutter_tex: ^4.0.6
Flutter version 3.24.0 on channel stable
Dart version 3.5.0

I have tried this to 30-100 users. There are a small of user that their device dosen't display or showing anything.
Their devices are:

-Samsung Galaxy J7+
-Redmi 9 (lancelot)
-Redmi 9c
-OPPO A15s
-Redmi 9a
-Samsung A03

Sometimes it's display some text, sometimes it doesn't show anything,

How do i place the TeXView():

using 5 TeXView() in 1 page, and only using TeXViewDocument() as the child,

 TeXView(
        renderingEngine: controller.renderingEngine,
        child: TeXViewDocument(
          textSoal,
          style: TeXViewStyle(
            sizeUnit: TeXViewSizeUnit.pixels,
            fontStyle: TeXViewFontStyle(
              fontSize: fontSize,
              fontFamily: 'lato',
              sizeUnit: TeXViewSizeUnit.pixels,
            ),
            padding: texViewPadding,
          ),
        ),
        fonts: [
          TeXViewFont(
            fontFamily: 'lato',
            src: 'assets/fonts/lato-regular.ttf',
          ),
          TeXViewFont(
            fontFamily: 'source-sans-pro',
            src: 'assets/fonts/source-sans-pro.bold.ttf',
          ),
        ],
        loadingWidgetBuilder: (context) {
          return TeXViewLoadingBuilderWithShimmerEffect();
        },
      );
    });

My first TexView() is used for Question with short or long text,

2 - 5 TexView() are used for Option:
A: "...."
B: "..."
C: "..."
D:"..."
E:"..."

Sometimes it has force close the app, but maybe it's because I have used more than 1 TexView() in one page.

But, what about their device dosen't display or showing anything from that TexView()?
What caused it?

@IrfanKnowledge
Copy link
Author

IrfanKnowledge commented Oct 18, 2024

I have done some experiments, using DevicePreview. It seems the caused about their device doesn't display or showing anything from that TexView() is FontSize or TexScalling.

When using Device Preview with these settings:
-width: 360.0,
-long text,
-TextScalling 1.0

From TexView(), i set font size to 20.

it will blank ( doesn't display or showing anything from that TexView() ), and then force close.

But maybe on real device, it's not force close but only doesn't display or showing anything from that TexView(),

@IrfanKnowledge
Copy link
Author

IrfanKnowledge commented Oct 24, 2024

@Shahxad-Akram is there any way to force textScaling inside TexView(), is set to noScaling?

Because not every device have their font size or text scaling settings on android is set to XS (extra small).
On my case, all those device problem are using font size or text scaling more larger than XS and the font size insisde TexView() will be affected.

I have tried to use MediaQuery, set textScalling to noScalling, but it can't override textScalling inside TexView();

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

1 participant