1

I have a problem in Flutter displaying Strings that contain character sequence "ff". It is reproducible both with Text and TextInput widget in several different cases (string value hardcoded, string stored as a constant, string read from JSON file,...).

Simple example to illustrate:

@override
  Widget build(BuildContext context) {
    print("Difficulty and take off");
    return Scaffold(
        body: Center(
          child: Text("Difficulty and take off"),
        ));
  }

This gets displayed as "Diculty and take o": see screenshot

However, print command correctly displays it in the console. Also if I use RichText widget it also displays correctly:

RichText(text: TextSpan(text: "Difficulty and take off", style: TextStyle(color: Colors.black)))

While using RichText all over the app is a possible workaround (although not a very nice one), I still have no idea how to solve the problem with TextInput. When a user types the "ff" sequence, it just disappears.

I'm building my app on Windows 10 using Android Studio 4.0.1. So far I've tried:

  • using different devices (Samsung, Huawei) -> all the same
  • upgrading flutter to 2.2.1 -> same

When debugging in Android Studio, the field value is correct (contains the "ff" char sequence), it just doesn't get displayed on the screen.

I have a deadline for production release in 14 days and I'm running out of ideas. Any help would be much appreciated.

flutter --version
Flutter 2.2.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 02c026b03c (11 days ago) • 2021-05-27 12:24:44 -0700
Engine • revision 0fdb562ac8
Tools • Dart 2.13.1
Urša Gorše
  • 101
  • 1
  • 5
  • 1
    I don't know Flutter, but it's probably because your font has ligatures enabled, so `ff` is actually `ff` (one single character), and maybe the font doesn't have such code (like [here](https://stackoverflow.com/q/56523423/5160230)). Can you try with another font and see if the problem persists? – Héliton Martins Jun 08 '21 at 01:30
  • Which font you are using? It seems like the font you are using don't have any implementation of 'f' 'F' – Chirag Bargoojar Jun 08 '21 at 02:51
  • I was using Gilroy font before, but now I've tried with Montserrat and it started displaying `ff`. Thank you very much!! – Urša Gorše Jun 08 '21 at 07:07

0 Answers0