Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/web_ui/lib/src/engine/text/font_collection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ class _FontManager {
String asset,
Map<String, String> 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 crashes if you create a [html.FontFace] with a font
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crashes -> crash

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// 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.
Expand Down