1

I'm trying to use non breaking space in order to keep a Brand name on the same line.

I've successfully implemented the solution found here: https://stackoverflow.com/a/67049738 But the non breaking space end up with no space at all.

I even tried a simpler solution adding the unicode directly into the String, and still no luck.

Text(
 "Brand\u{00A0}Name",
 textAlign: TextAlign.center,
)

And how it's rendered enter image description here

Is it possible the font used doesn't support non-breaking space?

alan_langlois
  • 476
  • 1
  • 4
  • 10

1 Answers1

1

My guess was right, the custom font I use does not support non breaking space char. I've tried to use the default native font "Roboto" instead of my custom font and the solution posted in my previous message works just fine, as well as the one linked.

:: custom font:

enter image description here

Text(
     "Brand\u{00A0}Name",
     style: TextStyle(fontFamily: 'CustomFont'),
)

:: Roboto font:

enter image description here

Text(
       "Brand\u{00A0}Name",
       style: TextStyle(fontFamily: 'Roboto'),
)
alan_langlois
  • 476
  • 1
  • 4
  • 10