0

I would like to turn off the font ligatures for a text. I use the Fira Code font, but I can't find a way to turn off the ligatures in TextStyle in my app. Can anyone help me?

  • Possibly related https://stackoverflow.com/questions/56523423/how-to-disable-ligatures-in-fonts-in-flutter – phuzi Jul 25 '22 at 14:50
  • @phuzi No, I've already seen that one. I want to disable these ligatures as in the picture. [example](https://imgur.com/a/WA0NPAS) – cheetahbyte Jul 25 '22 at 14:56

1 Answers1

0

When you use a Text widget, you can enable or disable various FontFeatures via its TextStyle. Looking at Fira Code in https://wakamaifondue.com/, it appears ligatures are controlled by the calt feature, which is enabled by default. You therefore could try disabling that:

Text(
  someString,
  style: TextStyle(fontFeatures: [FontFeature.disable('calt')]),
)

Alternatively, Fira Code is open-source and has build options to enable or disable features in the generated font files.

jamesdlin
  • 81,374
  • 13
  • 159
  • 204