flutterdartvariable-fonts

how to change Font dots mode in flutter?


I have a variable font and I want to use it in my project, but I can't use one of its options. This option changes the status of dots in Persian language

If anyone has a solution for it, please tell me , thanks

I used DefaultTextStyle and FontFeature but it didn't work. i dont see a property for change dots mode

this is dots mode in my variable font : -


Solution

  • in new version of sdk this is so easy you must go to your Text >> Textstyle >> fontVariations then you apply the changes

    Text("سپه سالار ایران زمین", style : TextStyle(fontFamily : 
          "IRANYeaknXVF" ,
          fontSize : 18.0,
          fontVariations: const <FontVariation>[
             FontVariation("dots", 1), // Set any dot you want
             FontVariation("wght", 500), // Set any weight you want
          ],
       )
    )
    

    in pubspec.yaml you should import it like this :

        - family: IRANYekanXVF
      fonts:
        - asset: assets/fonts/iranYekanX/IRANYekanXVF.ttf