flutter-packages icon indicating copy to clipboard operation
flutter-packages copied to clipboard

Roboto_regular is not the same as Roboto

Open TheCarpetMerchant opened this issue 2 years ago • 6 comments

Package

google_fonts

Existing issue?

What happened?

Expected vs actual result:

Letters are rendered correctly whether the Roboto font is loaded through google_fonts or not.

Steps to reproduce:

See attached code. The text is rendered perfectly fine as long as you don't load the Google Font. Once loaded, the "Roboto_regular' text breaks. Is the 'regular' variant of Roboto not the default one ?

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

void main() {
  runApp(const MaterialApp(
    home: MyHomePage(),
  ));
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  void loadGoodleFont() {
    GoogleFonts.getFont('Roboto');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Test'),
        actions: [
          IconButton(
            onPressed: loadGoodleFont,
            icon: const Icon(Icons.refresh,),
          ),
        ],
      ),
      body: Column(
        children: const [
          Text(
            'S̴i̴L̴e̶N̷c̴E̷.̷ ̴',
            style: TextStyle(fontFamily: 'Roboto'),
          ),
          Text(
            'S̴i̴L̴e̶N̷c̴E̷.̷ ̴',
            style: TextStyle(fontFamily: 'Roboto_regular'),
          ),
        ],
      ),
    );
  }
}

Relevant log output

[√] Flutter (Channel stable, 3.7.6, on Microsoft Windows [Version 10.0.19044.2604], locale fr-BE)
    • Flutter version 3.7.6 on channel stable at D:\Code\Flutter\sdk\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 12cb4eb7a0 (8 days ago), 2023-03-01 10:29:26 -0800
    • Engine revision ada363ee93
    • Dart version 2.19.3
    • DevTools version 2.20.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\user\AppData\Local\Android\sdk
    • Platform android-33, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.76.0)
    • VS Code at C:\Users\user\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.44.0

[√] VS Code, 64-bit edition (version 1.74.3)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.44.0

[√] Connected device (1 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 13 (API 33) (emulator)

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

TheCarpetMerchant avatar Mar 09 '23 14:03 TheCarpetMerchant

I'm unable to reproduce, this is a screenshot showing before/after pressing the icon button Screenshot 2023-04-20 at 11 17 02

Can you please provide more info?

guidezpl avatar Apr 20 '23 09:04 guidezpl

I've had the problem on Android and Windows, I don't own any Apple devices. So this might not be an issue on those platforms ? Here's what I get after clicking the button : image

TheCarpetMerchant avatar Apr 24 '23 18:04 TheCarpetMerchant

Can you provide Android and Windows versions?

guidezpl avatar Apr 25 '23 06:04 guidezpl

Everything is still the same as in the OP, except I'm now on Flutter 3.7.10.

TheCarpetMerchant avatar Apr 28 '23 09:04 TheCarpetMerchant

I was unable to repro on Windows (Windows native and Chrome). Have you followed https://docs.flutter.dev/data-and-backend/networking?

guidezpl avatar Jun 21 '23 08:06 guidezpl

The page you're linking does not mention anything about either Chrome or Windows. I have the issue on both Windows & Android, and the Android app does have the necessary permissions.

TheCarpetMerchant avatar Jul 04 '23 12:07 TheCarpetMerchant