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

[BUG] Nunito font from package google_fonts 2.1.1 didn't display Cyrillic correctly #207

Closed
Alexqwesa opened this issue Dec 30, 2021 · 2 comments · Fixed by #239
Closed
Assignees
Labels
bug Something isn't working

Comments

@Alexqwesa
Copy link

Alexqwesa commented Dec 30, 2021

Describe the bug
Nunito font from package google_fonts 2.1.1 didn't display Cyrillic correctly

To Reproduce
Steps to reproduce the behavior:

  1. add google_fonts to project
  2. use code below (text with nunito font)
  3. See Cyrillic symbols in some other font (not nunito)

for comparison i tried lobster font (with same settings) - it works as expected

https://github.com/Alexqwesa/test_task_pizza_shop_project/blob/master/lib/bug_screen.dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

class BugScreen extends StatefulWidget {
  const BugScreen({Key? key}) : super(key: key);

  @override
  _BugScreenState createState() => _BugScreenState();
}

class _BugScreenState extends State<BugScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // resizeToAvoidBottomInset: false,
      body: SizedBox.expand(
        child: Column(
          children: [
            const Divider(
              thickness: 10,
            ),
            const Text(
              ' Регистрация Nunito(font from asset) - it works',
              style: TextStyle(
                fontFamily: 'NunitoAsset',
                fontSize: 50,
                fontWeight: FontWeight.w800,
                color: Colors.black,
              ),
            ),
            const Divider(
              thickness: 10,
            ),
            Text(
              'Регистрация Nunito - did not work',
              style: GoogleFonts.nunito(
                // this didn't work
                textStyle: const TextStyle(
                  fontSize: 50,
                  fontWeight: FontWeight.w800,
                  color: Colors.black,
                ),
              ),
            ),
            const Divider(
              thickness: 10,
            ),
            Text(
              'Регистрация Lobster(font from GoogleFonts) - the same config works',
              style: GoogleFonts.lobster(
                // this works!!!!
                textStyle: const TextStyle(
                  fontSize: 50,
                  fontWeight: FontWeight.w800,
                  color: Colors.black,
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Expected behavior
Cyrillic symbols should be displayed in nanito font than i use nanito font from package google_fonts 2.1.1

Screenshots
font bug
https://github.com/Alexqwesa/test_task_pizza_shop_project/blob/master/lib/screenshot_of_font_bug.png

Smartphone (please complete the following information if applicable):

  • any
@guidezpl
Copy link
Collaborator

guidezpl commented Dec 30, 2021

Correct me if I'm wrong, but it looks to be rendering the same font, just at a different font weight. Does #35 answer your question?

@guidezpl guidezpl added the waiting for developer response The team cannot make further progress on this issue until the original reporter responds label Dec 30, 2021
@Alexqwesa
Copy link
Author

Alexqwesa commented Dec 30, 2021

Correct me if I'm wrong, but it looks to be rendering the same font, just at a different font weight. Does #35 answer your question?

Yes, i have that bug too,

But this is a different bug, as you can see in the image bellow:

  • on left side there is a four letter in Nanito style(two english and two cyrillic),
  • on the other side there two of four characters in nanito style(english), and two other characters(cyrilic) in some different font and this is a bug, because in code below you can see that they all have Nunito font

https://github.com/Alexqwesa/test_task_pizza_shop_project/blob/master/lib/bug_screen2.dart

Screenshot_20211230_222619

        child: Column(
          children: [
            for (int i = 0; i < 9; i++)
              Row(
                children: [
                  Expanded(
                    child: Text(
                      'aR аЯ',
                      style: TextStyle(
                        fontFamily: 'NunitoAsset',
                        fontSize: 64,
                        fontWeight: FontWeight.values.elementAt(i),
                        color: Colors.black,
                      ),
                    ),
                  ),

                  Container(
                    height: 64.0,
                    width: 1.0,
                    color: Colors.black,
                    margin: const EdgeInsets.only(left: 10.0, right: 10.0),
                  ),
                  Expanded(
                    child: Text(
                      'aR аЯ',
                      style: GoogleFonts.nunito(
                        // this didn't work
                        textStyle: TextStyle(
                          fontSize: 64,
                          fontWeight: FontWeight.values.elementAt(i),
                          color: Colors.black,
                        ),
                      ),
                    ),
                  ),
                ],
              ),
],),

@guidezpl guidezpl added bug Something isn't working and removed waiting for developer response The team cannot make further progress on this issue until the original reporter responds labels Feb 5, 2022
@guidezpl guidezpl mentioned this issue May 20, 2022
@guidezpl guidezpl self-assigned this May 20, 2022
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

Successfully merging a pull request may close this issue.

2 participants