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

localeResolutionCallback doesn't work correctly #36

Closed
bbrto21 opened this issue Feb 4, 2021 · 7 comments
Closed

localeResolutionCallback doesn't work correctly #36

bbrto21 opened this issue Feb 4, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@bbrto21
Copy link

bbrto21 commented Feb 4, 2021

Problem

  • If you use localeResolutioncallback, you get the wrong locale value
  • Sample codes
    // ...
    import 'package:flutter_localizations/flutter_localizations.dart';
    // ...
          localizationsDelegates: [
            GlobalMaterialLocalizations.delegate,
            GlobalWidgetsLocalizations.delegate,
            GlobalCupertinoLocalizations.delegate,
          ],
          localeResolutionCallback:
              (Locale locale, Iterable<Locale> supportedLocales) {
            print("localeResolutionCallback!!");
            print("locale.countryCode : " + locale.countryCode.toString());
            print("locale.languageCode : " + locale.languageCode.toString());
            return locale;
         }

How to reproduce

  1. Launch the app
  2. Change device language to another language
  3. Resume the app

as is

  • The locale value is always wrong.
    image

expected

  • The locale value should reflect the language of the device.
    image
@swift-kim
Copy link
Member

swift-kim commented Feb 4, 2021

I had the same issue of Gallery app being displayed in Afrikaans on my emulators.

@bbrto21
Copy link
Author

bbrto21 commented Feb 4, 2021

I had the same issue Gallery app being displayed in Afrikaans on my emulators.

I started by analyzing the gallery app too. and I guess that there are some problems.

  • First, it doesn't reflect the device language
  • Second, it seems that the fallback font is not selected properly (I haven't found a clear reason yet.)
    It seems that CJK cannot be displayed properly due to the above two problems.

@bbrto21
Copy link
Author

bbrto21 commented Feb 4, 2021

Second, it seems that the fallback font is not selected properly (I haven't found a clear reason yet.)

we need to check whether the text is displayed properly when specify the font family including CJK explicitly

@bbrto21 bbrto21 added the bug Something isn't working label Feb 4, 2021
@swift-kim
Copy link
Member

It seems there are some fallback fonts under /usr/share/fallback_fonts that can be used to display non-alphabetic characters. Apparently SamsungOneUI or BreezeSans (in /usr/share/fonts) isn't enough to display all unicode characters. Still I don't fully understand how font resolution works on Tizen and inside the Flutter SDK. It was more complicated than I thought when I went through the underlying code before.

@bbrto21
Copy link
Author

bbrto21 commented Feb 4, 2021

if #38 is merged, flutter get a device locale properly

@bbrto21
Copy link
Author

bbrto21 commented Feb 5, 2021

It seems there are some fallback fonts under /usr/share/fallback_fonts that can be used to display non-alphabetic characters. Apparently SamsungOneUI or BreezeSans (in /usr/share/fonts) isn't enough to display all unicode characters. Still I don't fully understand how font resolution works on Tizen and inside the Flutter SDK. It was more complicated than I thought when I went through the underlying code before.

I will open an issue for this

@bbrto21 bbrto21 self-assigned this Feb 5, 2021
@bbrto21
Copy link
Author

bbrto21 commented Feb 6, 2021

Resolved by #38

@bbrto21 bbrto21 closed this as completed Feb 6, 2021
swift-kim pushed a commit that referenced this issue Sep 1, 2022
Renders shaped text frames. Has the ability to plug into to different text
shapers and render glyphs using different techniques.

For now, the Aiks layer expects a prepared glyph atlas. But this will be changed
so that render pass will be responsible for preparing these and setting these on
the content renderer after pass consolidation.
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