diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/text/font_collection.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/text/font_collection.dart index 91b30c234f2..b6daf744a92 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/text/font_collection.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/text/font_collection.dart @@ -114,11 +114,11 @@ class _FontManager { String asset, Map descriptors, ) { - // Safari crashes if you create a [html.FontFace] with a font family that - // is not correct CSS syntax. To ensure the font family is accepted on - // Safari, wrap it in quotes. + // Safari and Firefox crash if you create a [html.FontFace] with a font + // family that is not correct CSS syntax. To ensure the font family is + // accepted on these browsers, wrap it in quotes. // See: https://drafts.csswg.org/css-fonts-3/#font-family-prop - if (browserEngine == BrowserEngine.webkit) { + if (browserEngine == BrowserEngine.webkit || browserEngine == BrowserEngine.firefox) { family = "'$family'"; } // try/catch because `new FontFace` can crash with an improper font family.